js/src/tests/ecma/Math/15.8.2.10.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.2.10.js
     9    ECMA Section:       15.8.2.10  Math.log(x)
    10    Description:        return an approximiation to the natural logarithm of
    11    the argument.
    12    special cases:
    13    -   if arg is NaN       result is NaN
    14    -   if arg is <0        result is NaN
    15    -   if arg is 0 or -0   result is -Infinity
    16    -   if arg is 1         result is 0
    17    -   if arg is Infinity  result is Infinity
    18    Author:             christine@netscape.com
    19    Date:               7 july 1997
    20 */
    22 var SECTION = "15.8.2.10";
    23 var VERSION = "ECMA_1";
    24 var TITLE   = "Math.log(x)";
    25 var BUGNUMBER = "77391";
    27 startTest();
    29 writeHeaderToLog( SECTION + " "+ TITLE);
    32 new TestCase( SECTION,
    33 	      "Math.log.length",
    34 	      1,
    35 	      Math.log.length );
    38 new TestCase( SECTION,
    39 	      "Math.log()",
    40 	      Number.NaN,
    41 	      Math.log() );
    43 new TestCase( SECTION,
    44 	      "Math.log(void 0)",
    45 	      Number.NaN,
    46 	      Math.log(void 0) );
    48 new TestCase( SECTION,
    49 	      "Math.log(null)",
    50 	      Number.NEGATIVE_INFINITY,
    51 	      Math.log(null) );
    53 new TestCase( SECTION,
    54 	      "Math.log(true)",
    55 	      0,
    56 	      Math.log(true) );
    58 new TestCase( SECTION,
    59 	      "Math.log(false)",
    60 	      -Infinity,
    61 	      Math.log(false) );
    63 new TestCase( SECTION,
    64 	      "Math.log('0')",
    65 	      -Infinity,
    66 	      Math.log('0') );
    68 new TestCase( SECTION,
    69 	      "Math.log('1')",
    70 	      0,
    71 	      Math.log('1') );
    73 new TestCase( SECTION,
    74 	      "Math.log('Infinity')",
    75 	      Infinity,
    76 	      Math.log("Infinity") );
    79 new TestCase( SECTION,
    80 	      "Math.log(NaN)",
    81 	      Number.NaN,
    82 	      Math.log(Number.NaN) );
    84 new TestCase( SECTION,
    85 	      "Math.log(-0.0000001)",
    86 	      Number.NaN,
    87 	      Math.log(-0.000001)  );
    89 new TestCase( SECTION,
    90 	      "Math.log(-1)",
    91 	      Number.NaN,
    92 	      Math.log(-1)  );
    94 new TestCase( SECTION,
    95 	      "Math.log(0)",
    96 	      Number.NEGATIVE_INFINITY,
    97 	      Math.log(0) );
    99 new TestCase( SECTION,
   100 	      "Math.log(-0)",
   101 	      Number.NEGATIVE_INFINITY,
   102 	      Math.log(-0));
   104 new TestCase( SECTION,
   105 	      "Math.log(1)",
   106 	      0,
   107 	      Math.log(1) );
   109 new TestCase( SECTION,
   110 	      "Math.log(Infinity)",
   111 	      Number.POSITIVE_INFINITY,
   112 	      Math.log(Number.POSITIVE_INFINITY) );
   114 new TestCase( SECTION,
   115 	      "Math.log(-Infinity)",
   116 	      Number.NaN,
   117 	      Math.log(Number.NEGATIVE_INFINITY) );
   119 test();

mercurial