blob: c789e6d6fb39e63f989cfe1517c18f5bb4a8ab11 [file] [log] [blame]
PASS (0.0).toExponential(4) is "0.0000e+0"
PASS (-0.0).toExponential(4) is "0.0000e+0"
PASS (0.0).toExponential() is "0e+0"
PASS (-0.0).toExponential() is "0e+0"
PASS (123.456).toExponential() is "1.23456e+2"
PASS (123.456).toExponential(0) is "1e+2"
PASS (123.456).toExponential(null) is "1e+2"
PASS (123.456).toExponential(false) is "1e+2"
PASS (123.456).toExponential('foo') is "1e+2"
PASS (123.456).toExponential(nan) is "1e+2"
PASS (123.456).toExponential(1) is "1.2e+2"
PASS (123.456).toExponential(true) is "1.2e+2"
PASS (123.456).toExponential('1') is "1.2e+2"
PASS (123.456).toExponential(2) is "1.23e+2"
PASS (123.456).toExponential(2.9) is "1.23e+2"
PASS (123.456).toExponential(3) is "1.235e+2"
PASS (123.456).toExponential(5) is "1.23456e+2"
PASS (123.456).toExponential(6) is "1.234560e+2"
FAIL (123.456).toExponential(20) should be 1.23456000000000003070e+2. Was 1.23456000000000000000e+2.
FAIL (123.456).toExponential(21) should be 1.234560000000000030695e+2. Threw exception RangeError: toExponential() argument must between 0 and 20
FAIL (123.456).toExponential(100) should be 1.2345600000000000306954461848363280296325683593750000000000000000000000000000000000000000000000000000e+2. Threw exception RangeError: toExponential() argument must between 0 and 20
PASS (123.456).toExponential(101) threw exception RangeError: toExponential() argument must between 0 and 20.
PASS (123.456).toExponential(-1) threw exception RangeError: toExponential() argument must between 0 and 20.
PASS (1234.567).toExponential(posInf) threw exception RangeError: toExponential() argument must between 0 and 20.
PASS (1234.567).toExponential(negInf) threw exception RangeError: toExponential() argument must between 0 and 20.
PASS posInf.toExponential() is "Infinity"
PASS negInf.toExponential() is "-Infinity"
PASS nan.toExponential() is "NaN"
PASS (0.01).toExponential() is "1e-2"
PASS (0.1).toExponential() is "1e-1"
PASS (0.9).toExponential() is "9e-1"
PASS (0.9999).toExponential() is "9.999e-1"
PASS (0.9999).toExponential(2) is "1.00e+0"
PASS successfullyParsed is true
TEST COMPLETE