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.

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

mercurial