tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

applying-the-exp-operator_A4.js (767B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: If base is NaN and exponent is nonzero, the result is NaN.
      6 esid: sec-applying-the-exp-operator
      7 ---*/
      8 
      9 
     10 var base = NaN;
     11 var exponent = new Array();
     12 exponent[0] = -Infinity;
     13 exponent[1] = -1.7976931348623157E308; //largest (by module) finite number
     14 exponent[2] = -0.000000000000001;
     15 exponent[3] = 0.000000000000001;
     16 exponent[4] = 1.7976931348623157E308; //largest finite number
     17 exponent[5] = +Infinity;
     18 exponent[6] = NaN;
     19 var exponentnum = 7;
     20 
     21 for (var i = 0; i < exponentnum; i++) {
     22  assert.sameValue(
     23    Math.pow(base, exponent[i]),
     24    NaN,
     25    "(" + base + ", " + exponent[i] + ")"
     26  );
     27 }
     28 
     29 reportCompare(0, 0);