js/src/tests/ecma/Math/15.8.1.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8    File Name:          15.8.1.js
     9    ECMA Section:       15.8.1.js   Value Properties of the Math Object
    10    15.8.1.1    E
    11    15.8.1.2    LN10
    12    15.8.1.3    LN2
    13    15.8.1.4    LOG2E
    14    15.8.1.5    LOG10E
    15    15.8.1.6    PI
    16    15.8.1.7    SQRT1_2
    17    15.8.1.8    SQRT2
    18    Description:        verify the values of some math constants
    19    Author:             christine@netscape.com
    20    Date:               7 july 1997
    22 */
    23 var SECTION = "15.8.1"
    24   var VERSION = "ECMA_1";
    25 startTest();
    26 var TITLE   = "Value Properties of the Math Object";
    28 writeHeaderToLog( SECTION + " "+ TITLE);
    31 new TestCase( "15.8.1.1", "Math.E",            
    32 	      2.7182818284590452354, 
    33 	      Math.E );
    35 new TestCase( "15.8.1.1",
    36 	      "typeof Math.E",     
    37 	      "number",              
    38 	      typeof Math.E );
    40 new TestCase( "15.8.1.2",
    41 	      "Math.LN10",         
    42 	      2.302585092994046,     
    43 	      Math.LN10 );
    45 new TestCase( "15.8.1.2",
    46 	      "typeof Math.LN10",  
    47 	      "number",              
    48 	      typeof Math.LN10 );
    50 new TestCase( "15.8.1.3",
    51 	      "Math.LN2",         
    52 	      0.6931471805599453,    
    53 	      Math.LN2 );
    55 new TestCase( "15.8.1.3",
    56 	      "typeof Math.LN2",   
    57 	      "number",              
    58 	      typeof Math.LN2 );
    60 new TestCase( "15.8.1.4",
    61 	      "Math.LOG2E",        
    62 	      1.4426950408889634,    
    63 	      Math.LOG2E );
    65 new TestCase( "15.8.1.4",
    66 	      "typeof Math.LOG2E", 
    67 	      "number",              
    68 	      typeof Math.LOG2E );
    70 new TestCase( "15.8.1.5",
    71 	      "Math.LOG10E",       
    72 	      0.4342944819032518,    
    73 	      Math.LOG10E);
    75 new TestCase( "15.8.1.5",
    76 	      "typeof Math.LOG10E",
    77 	      "number",              
    78 	      typeof Math.LOG10E);
    80 new TestCase( "15.8.1.6",
    81 	      "Math.PI",           
    82 	      3.14159265358979323846,
    83 	      Math.PI );
    85 new TestCase( "15.8.1.6",
    86 	      "typeof Math.PI",    
    87 	      "number",              
    88 	      typeof Math.PI );
    90 new TestCase( "15.8.1.7",
    91 	      "Math.SQRT1_2",      
    92 	      0.7071067811865476,    
    93 	      Math.SQRT1_2);
    95 new TestCase( "15.8.1.7",
    96 	      "typeof Math.SQRT1_2",
    97 	      "number",             
    98 	      typeof Math.SQRT1_2);
   100 new TestCase( "15.8.1.8",
   101 	      "Math.SQRT2",        
   102 	      1.4142135623730951,    
   103 	      Math.SQRT2 );
   105 new TestCase( "15.8.1.8",
   106 	      "typeof Math.SQRT2", 
   107 	      "number",              
   108 	      typeof Math.SQRT2 );
   110 new TestCase( SECTION, 
   111 	      "var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS",
   112 	      "",
   113 	      eval("var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS") );
   115 test();

mercurial