1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma/Math/15.8.1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,115 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + File Name: 15.8.1.js 1.12 + ECMA Section: 15.8.1.js Value Properties of the Math Object 1.13 + 15.8.1.1 E 1.14 + 15.8.1.2 LN10 1.15 + 15.8.1.3 LN2 1.16 + 15.8.1.4 LOG2E 1.17 + 15.8.1.5 LOG10E 1.18 + 15.8.1.6 PI 1.19 + 15.8.1.7 SQRT1_2 1.20 + 15.8.1.8 SQRT2 1.21 + Description: verify the values of some math constants 1.22 + Author: christine@netscape.com 1.23 + Date: 7 july 1997 1.24 + 1.25 +*/ 1.26 +var SECTION = "15.8.1" 1.27 + var VERSION = "ECMA_1"; 1.28 +startTest(); 1.29 +var TITLE = "Value Properties of the Math Object"; 1.30 + 1.31 +writeHeaderToLog( SECTION + " "+ TITLE); 1.32 + 1.33 + 1.34 +new TestCase( "15.8.1.1", "Math.E", 1.35 + 2.7182818284590452354, 1.36 + Math.E ); 1.37 + 1.38 +new TestCase( "15.8.1.1", 1.39 + "typeof Math.E", 1.40 + "number", 1.41 + typeof Math.E ); 1.42 + 1.43 +new TestCase( "15.8.1.2", 1.44 + "Math.LN10", 1.45 + 2.302585092994046, 1.46 + Math.LN10 ); 1.47 + 1.48 +new TestCase( "15.8.1.2", 1.49 + "typeof Math.LN10", 1.50 + "number", 1.51 + typeof Math.LN10 ); 1.52 + 1.53 +new TestCase( "15.8.1.3", 1.54 + "Math.LN2", 1.55 + 0.6931471805599453, 1.56 + Math.LN2 ); 1.57 + 1.58 +new TestCase( "15.8.1.3", 1.59 + "typeof Math.LN2", 1.60 + "number", 1.61 + typeof Math.LN2 ); 1.62 + 1.63 +new TestCase( "15.8.1.4", 1.64 + "Math.LOG2E", 1.65 + 1.4426950408889634, 1.66 + Math.LOG2E ); 1.67 + 1.68 +new TestCase( "15.8.1.4", 1.69 + "typeof Math.LOG2E", 1.70 + "number", 1.71 + typeof Math.LOG2E ); 1.72 + 1.73 +new TestCase( "15.8.1.5", 1.74 + "Math.LOG10E", 1.75 + 0.4342944819032518, 1.76 + Math.LOG10E); 1.77 + 1.78 +new TestCase( "15.8.1.5", 1.79 + "typeof Math.LOG10E", 1.80 + "number", 1.81 + typeof Math.LOG10E); 1.82 + 1.83 +new TestCase( "15.8.1.6", 1.84 + "Math.PI", 1.85 + 3.14159265358979323846, 1.86 + Math.PI ); 1.87 + 1.88 +new TestCase( "15.8.1.6", 1.89 + "typeof Math.PI", 1.90 + "number", 1.91 + typeof Math.PI ); 1.92 + 1.93 +new TestCase( "15.8.1.7", 1.94 + "Math.SQRT1_2", 1.95 + 0.7071067811865476, 1.96 + Math.SQRT1_2); 1.97 + 1.98 +new TestCase( "15.8.1.7", 1.99 + "typeof Math.SQRT1_2", 1.100 + "number", 1.101 + typeof Math.SQRT1_2); 1.102 + 1.103 +new TestCase( "15.8.1.8", 1.104 + "Math.SQRT2", 1.105 + 1.4142135623730951, 1.106 + Math.SQRT2 ); 1.107 + 1.108 +new TestCase( "15.8.1.8", 1.109 + "typeof Math.SQRT2", 1.110 + "number", 1.111 + typeof Math.SQRT2 ); 1.112 + 1.113 +new TestCase( SECTION, 1.114 + "var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS", 1.115 + "", 1.116 + eval("var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS") ); 1.117 + 1.118 +test();