js/src/tests/ecma/Math/15.8.2.8.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.8.js
     9    ECMA Section:       15.8.2.8  Math.exp(x)
    10    Description:        return an approximation to the exponential function of
    11    the argument (e raised to the power of the argument)
    12    special cases:
    13    -   if x is NaN         return NaN
    14    -   if x is 0           return 1
    15    -   if x is -0          return 1
    16    -   if x is Infinity    return Infinity
    17    -   if x is -Infinity   return 0
    18    Author:             christine@netscape.com
    19    Date:               7 july 1997
    20 */
    23 var SECTION = "15.8.2.8";
    24 var VERSION = "ECMA_1";
    25 startTest();
    26 var TITLE   = "Math.exp(x)";
    28 writeHeaderToLog( SECTION + " "+ TITLE);
    30 new TestCase( SECTION,
    31 	      "Math.exp.length",
    32 	      1,
    33 	      Math.exp.length );
    35 new TestCase( SECTION,
    36 	      "Math.exp()",
    37 	      Number.NaN,
    38 	      Math.exp() );
    40 new TestCase( SECTION,
    41 	      "Math.exp(null)",
    42 	      1,
    43 	      Math.exp(null) );
    45 new TestCase( SECTION,
    46 	      "Math.exp(void 0)",
    47 	      Number.NaN,
    48 	      Math.exp(void 0) );
    50 new TestCase( SECTION,
    51 	      "Math.exp(1)",
    52 	      Math.E,
    53 	      Math.exp(1) );
    55 new TestCase( SECTION,
    56 	      "Math.exp(true)",
    57 	      Math.E,
    58 	      Math.exp(true) );
    60 new TestCase( SECTION,
    61 	      "Math.exp(false)",
    62 	      1,
    63 	      Math.exp(false) );
    65 new TestCase( SECTION,
    66 	      "Math.exp('1')",
    67 	      Math.E,
    68 	      Math.exp('1') );
    70 new TestCase( SECTION,
    71 	      "Math.exp('0')",
    72 	      1,
    73 	      Math.exp('0') );
    75 new TestCase( SECTION,
    76 	      "Math.exp(NaN)",
    77 	      Number.NaN,
    78 	      Math.exp(Number.NaN) );
    80 new TestCase( SECTION,
    81 	      "Math.exp(0)",
    82 	      1,
    83 	      Math.exp(0)          );
    85 new TestCase( SECTION,
    86 	      "Math.exp(-0)",
    87 	      1,
    88 	      Math.exp(-0)         );
    90 new TestCase( SECTION,
    91 	      "Math.exp(Infinity)",
    92 	      Number.POSITIVE_INFINITY,
    93 	      Math.exp(Number.POSITIVE_INFINITY) );
    95 new TestCase( SECTION,
    96 	      "Math.exp(-Infinity)", 
    97 	      0,
    98 	      Math.exp(Number.NEGATIVE_INFINITY) );
   100 test();

mercurial