# Copyright 2013 the V8 project authors. All rights reserved. # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KDE JS Test On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS Number() is 0 PASS Number(1) is 1 PASS Number(1.1) is 1.1 PASS Number('1.2') is 1.2 PASS isNaN(Number('a')) is true PASS (new Number()).valueOf() is 0 PASS (new Number(.4)).valueOf() is 0.4 PASS (new Number('1.')).valueOf() is 1 PASS isNaN(new Number('a')) is true PASS isNaN(Number.NaN) is true PASS Number.NEGATIVE_INFINITY is -Infinity PASS Number.POSITIVE_INFINITY is Infinity PASS (1).toString() is '1' PASS typeof (1).toString() is 'string' PASS (10).toString(16) is 'a' PASS (8.5).toString(16) is '8.8' PASS (-8.5).toString(16) is '-8.8' PASS Number.NaN.toString(16) is 'NaN' PASS Number.POSITIVE_INFINITY.toString(16) is 'Infinity' PASS Number.NEGATIVE_INFINITY.toString(16) is '-Infinity' PASS Number.MAX_VALUE.toString(2).length is 1024 PASS (1).valueOf() is 1 PASS typeof (1).valueOf() is 'number' PASS Number(1234.567).toFixed(0) is "1235" PASS Number(1234.567).toFixed(undefined) is "1235" PASS Number(-1234.567).toFixed(0) is "-1235" PASS Number(-1234.567).toFixed(undefined) is "-1235" PASS Number(0).toFixed(7) is "0.0000000" PASS Number(0.003).toFixed(0) is "0" PASS Number(-0.003).toFixed(0) is "-0" PASS Number(40.1234567890123).toFixed(7) is "40.1234568" PASS Number(-40.1234567890123).toFixed(7) is "-40.1234568" PASS Number(4).toFixed(7) is "4.0000000" PASS Number(-4).toFixed(7) is "-4.0000000" PASS Number(0.000056).toFixed(7) is "0.0000560" PASS Number(-0.000056).toFixed(7) is "-0.0000560" PASS Number(NaN).toFixed(7) is "NaN" PASS Number(Infinity).toFixed(7) is "Infinity" PASS Number(-Infinity).toFixed(7) is "-Infinity" PASS Number(Math.pow(10,4)).toFixed(13) is "10000.0000000000000" PASS Number(Math.pow(10,17)).toFixed(16) is "100000000000000000.0000000000000000" PASS Number(Math.pow(10,18)).toFixed(17) is "1000000000000000000.00000000000000000" PASS Number(Math.pow(10,19)).toFixed(18) is "10000000000000000000.000000000000000000" PASS Number(Math.pow(10,17)).toFixed(20) is "100000000000000000.00000000000000000000" PASS Number(Math.pow(10,18)).toFixed(20) is "1000000000000000000.00000000000000000000" PASS Number(Math.pow(10,19)).toFixed(20) is "10000000000000000000.00000000000000000000" PASS Number(Math.pow(10,20)).toFixed(20) is "100000000000000000000.00000000000000000000" PASS Number(Math.pow(10,21)).toFixed(20) is "1e+21" PASS Number(-Math.pow(10,4)).toFixed(13) is "-10000.0000000000000" PASS Number(-Math.pow(10,17)).toFixed(16) is "-100000000000000000.0000000000000000" PASS Number(-Math.pow(10,18)).toFixed(17) is "-1000000000000000000.00000000000000000" PASS Number(-Math.pow(10,19)).toFixed(18) is "-10000000000000000000.000000000000000000" PASS Number(-Math.pow(10,17)).toFixed(20) is "-100000000000000000.00000000000000000000" PASS Number(-Math.pow(10,18)).toFixed(20) is "-1000000000000000000.00000000000000000000" PASS Number(-Math.pow(10,19)).toFixed(20) is "-10000000000000000000.00000000000000000000" PASS Number(-Math.pow(10,20)).toFixed(20) is "-100000000000000000000.00000000000000000000" PASS Number(-Math.pow(10,21)).toFixed(20) is "-1e+21" PASS toFixedOrException(2,-1).indexOf('Range') >= 0 is true PASS Number(2).toFixed(0) is "2" PASS Number(2).toFixed(20) is "2.00000000000000000000" FAIL toFixedOrException(2,21).indexOf('Range') >= 0 should be true. Was false. PASS toFixedOrException(-2,-1).indexOf('Range') >= 0 is true PASS Number(-2).toFixed(0) is "-2" PASS Number(-2).toFixed(20) is "-2.00000000000000000000" FAIL toFixedOrException(-2,21).indexOf('Range') >= 0 should be true. Was false. PASS Number(NaN).toExponential() is "NaN" PASS Number(Infinity).toExponential() is "Infinity" PASS Number(-Infinity).toExponential() is "-Infinity" PASS Number(NaN).toExponential(4) is "NaN" PASS Number(Infinity).toExponential(4) is "Infinity" PASS Number(-Infinity).toExponential(4) is "-Infinity" PASS Number(123.456).toExponential() is "1.23456e+2" PASS try { Number(123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(123.456).toExponential(0) is "1e+2" PASS Number(123.456).toExponential(1) is "1.2e+2" PASS Number(123.456).toExponential(2) is "1.23e+2" PASS Number(123.456).toExponential(3) is "1.235e+2" PASS Number(123.456).toExponential(4) is "1.2346e+2" PASS Number(123.456).toExponential(5) is "1.23456e+2" PASS Number(123.456).toExponential(6) is "1.234560e+2" PASS Number(123.456).toExponential(7) is "1.2345600e+2" PASS Number(123.456).toExponential(8) is "1.23456000e+2" PASS Number(123.456).toExponential(9) is "1.234560000e+2" PASS Number(123.456).toExponential(10) is "1.2345600000e+2" PASS Number(123.456).toExponential(11) is "1.23456000000e+2" PASS Number(123.456).toExponential(12) is "1.234560000000e+2" PASS Number(123.456).toExponential(13) is "1.2345600000000e+2" PASS Number(123.456).toExponential(14) is "1.23456000000000e+2" PASS Number(123.456).toExponential(15) is "1.234560000000000e+2" PASS Number(123.456).toExponential(16) is "1.2345600000000000e+2" PASS Number(123.456).toExponential(17) is "1.23456000000000003e+2" PASS Number(123.456).toExponential(18) is "1.234560000000000031e+2" PASS Number(123.456).toExponential(19) is "1.2345600000000000307e+2" PASS Number(123.456).toExponential(20) is "1.23456000000000003070e+2" FAIL try { Number(123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was 1.234560000000000030695e+2 (of type string). PASS Number(-123.456).toExponential() is "-1.23456e+2" PASS try { Number(-123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(-123.456).toExponential(0) is "-1e+2" PASS Number(-123.456).toExponential(1) is "-1.2e+2" PASS Number(-123.456).toExponential(2) is "-1.23e+2" PASS Number(-123.456).toExponential(3) is "-1.235e+2" PASS Number(-123.456).toExponential(4) is "-1.2346e+2" PASS Number(-123.456).toExponential(5) is "-1.23456e+2" PASS Number(-123.456).toExponential(6) is "-1.234560e+2" PASS Number(-123.456).toExponential(7) is "-1.2345600e+2" PASS Number(-123.456).toExponential(8) is "-1.23456000e+2" PASS Number(-123.456).toExponential(9) is "-1.234560000e+2" PASS Number(-123.456).toExponential(10) is "-1.2345600000e+2" PASS Number(-123.456).toExponential(11) is "-1.23456000000e+2" PASS Number(-123.456).toExponential(12) is "-1.234560000000e+2" PASS Number(-123.456).toExponential(13) is "-1.2345600000000e+2" PASS Number(-123.456).toExponential(14) is "-1.23456000000000e+2" PASS Number(-123.456).toExponential(15) is "-1.234560000000000e+2" PASS Number(-123.456).toExponential(16) is "-1.2345600000000000e+2" PASS Number(-123.456).toExponential(17) is "-1.23456000000000003e+2" PASS Number(-123.456).toExponential(18) is "-1.234560000000000031e+2" PASS Number(-123.456).toExponential(19) is "-1.2345600000000000307e+2" PASS Number(-123.456).toExponential(20) is "-1.23456000000000003070e+2" FAIL try { Number(-123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was -1.234560000000000030695e+2 (of type string). PASS Number(.000123456).toExponential() is "1.23456e-4" PASS try { Number(.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(.000123456).toExponential(0) is "1e-4" PASS Number(.000123456).toExponential(1) is "1.2e-4" PASS Number(.000123456).toExponential(2) is "1.23e-4" PASS Number(.000123456).toExponential(3) is "1.235e-4" PASS Number(.000123456).toExponential(4) is "1.2346e-4" PASS Number(.000123456).toExponential(5) is "1.23456e-4" PASS Number(.000123456).toExponential(6) is "1.234560e-4" PASS Number(.000123456).toExponential(7) is "1.2345600e-4" PASS Number(.000123456).toExponential(8) is "1.23456000e-4" PASS Number(.000123456).toExponential(9) is "1.234560000e-4" PASS Number(.000123456).toExponential(10) is "1.2345600000e-4" PASS Number(.000123456).toExponential(11) is "1.23456000000e-4" PASS Number(.000123456).toExponential(12) is "1.234560000000e-4" PASS Number(.000123456).toExponential(13) is "1.2345600000000e-4" PASS Number(.000123456).toExponential(14) is "1.23456000000000e-4" PASS Number(.000123456).toExponential(15) is "1.234560000000000e-4" PASS Number(.000123456).toExponential(16) is "1.2345600000000001e-4" PASS Number(.000123456).toExponential(17) is "1.23456000000000005e-4" PASS Number(.000123456).toExponential(18) is "1.234560000000000052e-4" PASS Number(.000123456).toExponential(19) is "1.2345600000000000519e-4" PASS Number(.000123456).toExponential(20) is "1.23456000000000005188e-4" FAIL try { Number(.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was 1.234560000000000051876e-4 (of type string). PASS Number(-.000123456).toExponential() is "-1.23456e-4" PASS try { Number(-.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(-.000123456).toExponential(0) is "-1e-4" PASS Number(-.000123456).toExponential(1) is "-1.2e-4" PASS Number(-.000123456).toExponential(2) is "-1.23e-4" PASS Number(-.000123456).toExponential(3) is "-1.235e-4" PASS Number(-.000123456).toExponential(4) is "-1.2346e-4" PASS Number(-.000123456).toExponential(5) is "-1.23456e-4" PASS Number(-.000123456).toExponential(6) is "-1.234560e-4" PASS Number(-.000123456).toExponential(7) is "-1.2345600e-4" PASS Number(-.000123456).toExponential(8) is "-1.23456000e-4" PASS Number(-.000123456).toExponential(9) is "-1.234560000e-4" PASS Number(-.000123456).toExponential(10) is "-1.2345600000e-4" PASS Number(-.000123456).toExponential(11) is "-1.23456000000e-4" PASS Number(-.000123456).toExponential(12) is "-1.234560000000e-4" PASS Number(-.000123456).toExponential(13) is "-1.2345600000000e-4" PASS Number(-.000123456).toExponential(14) is "-1.23456000000000e-4" PASS Number(-.000123456).toExponential(15) is "-1.234560000000000e-4" PASS Number(-.000123456).toExponential(16) is "-1.2345600000000001e-4" PASS Number(-.000123456).toExponential(17) is "-1.23456000000000005e-4" PASS Number(-.000123456).toExponential(18) is "-1.234560000000000052e-4" PASS Number(-.000123456).toExponential(19) is "-1.2345600000000000519e-4" PASS Number(-.000123456).toExponential(20) is "-1.23456000000000005188e-4" FAIL try { Number(-.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was -1.234560000000000051876e-4 (of type string). PASS Number(123.4567890123456789012).toExponential() is "1.2345678901234568e+2" PASS try { Number(123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(123.4567890123456789012).toExponential(0) is "1e+2" PASS Number(123.4567890123456789012).toExponential(1) is "1.2e+2" PASS Number(123.4567890123456789012).toExponential(2) is "1.23e+2" PASS Number(123.4567890123456789012).toExponential(3) is "1.235e+2" PASS Number(123.4567890123456789012).toExponential(4) is "1.2346e+2" PASS Number(123.4567890123456789012).toExponential(5) is "1.23457e+2" PASS Number(123.4567890123456789012).toExponential(6) is "1.234568e+2" PASS Number(123.4567890123456789012).toExponential(7) is "1.2345679e+2" PASS Number(123.4567890123456789012).toExponential(8) is "1.23456789e+2" PASS Number(123.4567890123456789012).toExponential(9) is "1.234567890e+2" PASS Number(123.4567890123456789012).toExponential(10) is "1.2345678901e+2" PASS Number(123.4567890123456789012).toExponential(11) is "1.23456789012e+2" PASS Number(123.4567890123456789012).toExponential(12) is "1.234567890123e+2" PASS Number(123.4567890123456789012).toExponential(13) is "1.2345678901235e+2" PASS Number(123.4567890123456789012).toExponential(14) is "1.23456789012346e+2" PASS Number(123.4567890123456789012).toExponential(15) is "1.234567890123457e+2" PASS Number(123.4567890123456789012).toExponential(16) is "1.2345678901234568e+2" PASS Number(123.4567890123456789012).toExponential(17) is "1.23456789012345681e+2" PASS Number(123.4567890123456789012).toExponential(18) is "1.234567890123456806e+2" PASS Number(123.4567890123456789012).toExponential(19) is "1.2345678901234568059e+2" PASS Number(123.4567890123456789012).toExponential(20) is "1.23456789012345680590e+2" FAIL try { Number(123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was 1.234567890123456805895e+2 (of type string). PASS Number(-123.4567890123456789012).toExponential() is "-1.2345678901234568e+2" PASS try { Number(-123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS Number(-123.4567890123456789012).toExponential(0) is "-1e+2" PASS Number(-123.4567890123456789012).toExponential(1) is "-1.2e+2" PASS Number(-123.4567890123456789012).toExponential(2) is "-1.23e+2" PASS Number(-123.4567890123456789012).toExponential(3) is "-1.235e+2" PASS Number(-123.4567890123456789012).toExponential(4) is "-1.2346e+2" PASS Number(-123.4567890123456789012).toExponential(5) is "-1.23457e+2" PASS Number(-123.4567890123456789012).toExponential(6) is "-1.234568e+2" PASS Number(-123.4567890123456789012).toExponential(7) is "-1.2345679e+2" PASS Number(-123.4567890123456789012).toExponential(8) is "-1.23456789e+2" PASS Number(-123.4567890123456789012).toExponential(9) is "-1.234567890e+2" PASS Number(-123.4567890123456789012).toExponential(10) is "-1.2345678901e+2" PASS Number(-123.4567890123456789012).toExponential(11) is "-1.23456789012e+2" PASS Number(-123.4567890123456789012).toExponential(12) is "-1.234567890123e+2" PASS Number(-123.4567890123456789012).toExponential(13) is "-1.2345678901235e+2" PASS Number(-123.4567890123456789012).toExponential(14) is "-1.23456789012346e+2" PASS Number(-123.4567890123456789012).toExponential(15) is "-1.234567890123457e+2" PASS Number(-123.4567890123456789012).toExponential(16) is "-1.2345678901234568e+2" PASS Number(-123.4567890123456789012).toExponential(17) is "-1.23456789012345681e+2" PASS Number(-123.4567890123456789012).toExponential(18) is "-1.234567890123456806e+2" PASS Number(-123.4567890123456789012).toExponential(19) is "-1.2345678901234568059e+2" PASS Number(-123.4567890123456789012).toExponential(20) is "-1.23456789012345680590e+2" FAIL try { Number(-123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was -1.234567890123456805895e+2 (of type string). PASS Number(.0000000000000000000001).toExponential() is "1e-22" PASS Number(.0000000000000000000012).toExponential() is "1.2e-21" PASS Number(.0000000000000000000123).toExponential() is "1.23e-20" PASS Number(.0000000000000000000123).toExponential() is "1.23e-20" PASS Number(.0000000000000000001234).toExponential() is "1.234e-19" PASS Number(.0000000000000000012345).toExponential() is "1.2345e-18" PASS Number(.0000000000000000123456).toExponential() is "1.23456e-17" PASS Number(.0000000000000001234567).toExponential() is "1.234567e-16" PASS Number(.0000000000000012345678).toExponential() is "1.2345678e-15" PASS Number(.0000000000000123456789).toExponential() is "1.23456789e-14" PASS Number(.0000000000001234567890).toExponential() is "1.23456789e-13" PASS Number(.0000000000012345678901).toExponential() is "1.2345678901e-12" PASS Number(.0000000000123456789012).toExponential() is "1.23456789012e-11" PASS Number(.0000000001234567890123).toExponential() is "1.234567890123e-10" PASS Number(.0000000012345678901234).toExponential() is "1.2345678901234e-9" PASS Number(.0000000123456789012345).toExponential() is "1.23456789012345e-8" PASS Number(.0000001234567890123456).toExponential() is "1.234567890123456e-7" PASS Number(.0000012345678901234567).toExponential() is "1.2345678901234567e-6" PASS Number(.0000123456789012345678).toExponential() is "1.2345678901234568e-5" PASS Number(.0001234567890123456789).toExponential() is "1.2345678901234567e-4" PASS Number(.0012345678901234567890).toExponential() is "1.2345678901234567e-3" PASS Number(.0123456789012345678901).toExponential() is "1.2345678901234568e-2" PASS Number(1.234567890123456789012).toExponential() is "1.2345678901234567e+0" PASS Number(12.34567890123456789012).toExponential() is "1.2345678901234567e+1" PASS Number(123.4567890123456789012).toExponential() is "1.2345678901234568e+2" PASS Number(1234.567890123456789012).toExponential() is "1.234567890123457e+3" PASS Number(12345.67890123456789012).toExponential() is "1.2345678901234567e+4" PASS Number(123456.7890123456789012).toExponential() is "1.2345678901234567e+5" PASS Number(1234567.890123456789012).toExponential() is "1.2345678901234567e+6" PASS Number(12345678.90123456789012).toExponential() is "1.2345678901234567e+7" PASS Number(123456789.0123456789012).toExponential() is "1.2345678901234567e+8" PASS Number(1234567890.123456789012).toExponential() is "1.2345678901234567e+9" PASS Number(12345678901.23456789012).toExponential() is "1.2345678901234568e+10" PASS Number(123456789012.3456789012).toExponential() is "1.2345678901234567e+11" PASS Number(1234567890123.456789012).toExponential() is "1.2345678901234568e+12" PASS Number(12345678901234.56789012).toExponential() is "1.2345678901234568e+13" PASS Number(123456789012345.6789012).toExponential() is "1.2345678901234567e+14" PASS Number(1234567890123456.789012).toExponential() is "1.2345678901234568e+15" PASS Number(12345678901234567.89012).toExponential() is "1.2345678901234568e+16" PASS Number(123456789012345678.9012).toExponential() is "1.2345678901234568e+17" PASS Number(1234567890123456789.012).toExponential() is "1.2345678901234568e+18" PASS Number(12345678901234567890.12).toExponential() is "1.2345678901234567e+19" PASS Number(123456789012345678901.2).toExponential() is "1.2345678901234568e+20" PASS Number(-.0000000000000000000001).toExponential() is "-1e-22" PASS Number(-.0000000000000000000012).toExponential() is "-1.2e-21" PASS Number(-.0000000000000000000123).toExponential() is "-1.23e-20" PASS Number(-.0000000000000000000123).toExponential() is "-1.23e-20" PASS Number(-.0000000000000000001234).toExponential() is "-1.234e-19" PASS Number(-.0000000000000000012345).toExponential() is "-1.2345e-18" PASS Number(-.0000000000000000123456).toExponential() is "-1.23456e-17" PASS Number(-.0000000000000001234567).toExponential() is "-1.234567e-16" PASS Number(-.0000000000000012345678).toExponential() is "-1.2345678e-15" PASS Number(-.0000000000000123456789).toExponential() is "-1.23456789e-14" PASS Number(-.0000000000001234567890).toExponential() is "-1.23456789e-13" PASS Number(-.0000000000012345678901).toExponential() is "-1.2345678901e-12" PASS Number(-.0000000000123456789012).toExponential() is "-1.23456789012e-11" PASS Number(-.0000000001234567890123).toExponential() is "-1.234567890123e-10" PASS Number(-.0000000012345678901234).toExponential() is "-1.2345678901234e-9" PASS Number(-.0000000123456789012345).toExponential() is "-1.23456789012345e-8" PASS Number(-.0000001234567890123456).toExponential() is "-1.234567890123456e-7" PASS Number(-.0000012345678901234567).toExponential() is "-1.2345678901234567e-6" PASS Number(-.0000123456789012345678).toExponential() is "-1.2345678901234568e-5" PASS Number(-.0001234567890123456789).toExponential() is "-1.2345678901234567e-4" PASS Number(-.0012345678901234567890).toExponential() is "-1.2345678901234567e-3" PASS Number(-.0123456789012345678901).toExponential() is "-1.2345678901234568e-2" PASS Number(-1.234567890123456789012).toExponential() is "-1.2345678901234567e+0" PASS Number(-12.34567890123456789012).toExponential() is "-1.2345678901234567e+1" PASS Number(-123.4567890123456789012).toExponential() is "-1.2345678901234568e+2" PASS Number(-1234.567890123456789012).toExponential() is "-1.234567890123457e+3" PASS Number(-12345.67890123456789012).toExponential() is "-1.2345678901234567e+4" PASS Number(-123456.7890123456789012).toExponential() is "-1.2345678901234567e+5" PASS Number(-1234567.890123456789012).toExponential() is "-1.2345678901234567e+6" PASS Number(-12345678.90123456789012).toExponential() is "-1.2345678901234567e+7" PASS Number(-123456789.0123456789012).toExponential() is "-1.2345678901234567e+8" PASS Number(-1234567890.123456789012).toExponential() is "-1.2345678901234567e+9" PASS Number(-12345678901.23456789012).toExponential() is "-1.2345678901234568e+10" PASS Number(-123456789012.3456789012).toExponential() is "-1.2345678901234567e+11" PASS Number(-1234567890123.456789012).toExponential() is "-1.2345678901234568e+12" PASS Number(-12345678901234.56789012).toExponential() is "-1.2345678901234568e+13" PASS Number(-123456789012345.6789012).toExponential() is "-1.2345678901234567e+14" PASS Number(-1234567890123456.789012).toExponential() is "-1.2345678901234568e+15" PASS Number(-12345678901234567.89012).toExponential() is "-1.2345678901234568e+16" PASS Number(-123456789012345678.9012).toExponential() is "-1.2345678901234568e+17" PASS Number(-1234567890123456789.012).toExponential() is "-1.2345678901234568e+18" PASS Number(-12345678901234567890.12).toExponential() is "-1.2345678901234567e+19" PASS Number(-123456789012345678901.2).toExponential() is "-1.2345678901234568e+20" PASS try { Number(1).toPrecision(-1); } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS try { Number(1).toPrecision(0); } catch (e) { String(e).indexOf('Range') >= 0; } is true PASS try { Number(1).toPrecision(1); } catch (e) { String(e); } is "1" PASS try { Number(1).toPrecision(21); } catch (e) { String(e); } is "1.00000000000000000000" FAIL try { Number(1).toPrecision(22); } catch (e) { String(e).indexOf('Range') >= 0; } should be true (of type boolean). Was 1.000000000000000000000 (of type string). PASS Number(NaN).toPrecision() is "NaN" PASS Number(NaN).toPrecision(1) is "NaN" PASS Number(Infinity).toPrecision() is "Infinity" PASS Number(Infinity).toPrecision(1) is "Infinity" PASS Number(-Infinity).toPrecision() is "-Infinity" PASS Number(-Infinity).toPrecision(1) is "-Infinity" PASS Number(.0000000012345).toPrecision(2) is "1.2e-9" PASS Number(.000000012345).toPrecision(2) is "1.2e-8" PASS Number(.00000012345).toPrecision(2) is "1.2e-7" PASS Number(.0000012345).toPrecision(2) is "0.0000012" PASS Number(.000012345).toPrecision(2) is "0.000012" PASS Number(.00012345).toPrecision(2) is "0.00012" PASS Number(.0012345).toPrecision(2) is "0.0012" PASS Number(.012345).toPrecision(2) is "0.012" PASS Number(.12345).toPrecision(2) is "0.12" PASS Number(1.2345).toPrecision(2) is "1.2" PASS Number(12.345).toPrecision(2) is "12" PASS Number(123.45).toPrecision(2) is "1.2e+2" PASS Number(1234.5).toPrecision(2) is "1.2e+3" PASS Number(12345).toPrecision(2) is "1.2e+4" PASS Number(12345.67).toPrecision(4) is "1.235e+4" PASS Number(12344.67).toPrecision(4) is "1.234e+4" PASS Number(0.0001234567890123456789012345).toPrecision() is "0.00012345678901234567" PASS Number(0.0001234567890123456789012345).toPrecision(1) is "0.0001" PASS Number(0.0001234567890123456789012345).toPrecision(2) is "0.00012" PASS Number(0.0001234567890123456789012345).toPrecision(3) is "0.000123" PASS Number(0.0001234567890123456789012345).toPrecision(4) is "0.0001235" PASS Number(0.0001234567890123456789012345).toPrecision(5) is "0.00012346" PASS Number(0.0001234567890123456789012345).toPrecision(6) is "0.000123457" PASS Number(0.0001234567890123456789012345).toPrecision(7) is "0.0001234568" PASS Number(0.0001234567890123456789012345).toPrecision(8) is "0.00012345679" PASS Number(0.0001234567890123456789012345).toPrecision(9) is "0.000123456789" PASS Number(0.0001234567890123456789012345).toPrecision(10) is "0.0001234567890" PASS Number(0.0001234567890123456789012345).toPrecision(11) is "0.00012345678901" PASS Number(0.0001234567890123456789012345).toPrecision(12) is "0.000123456789012" PASS Number(0.0001234567890123456789012345).toPrecision(13) is "0.0001234567890123" PASS Number(0.0001234567890123456789012345).toPrecision(14) is "0.00012345678901235" PASS Number(0.0001234567890123456789012345).toPrecision(15) is "0.000123456789012346" PASS Number(0.0001234567890123456789012345).toPrecision(16) is "0.0001234567890123457" PASS Number(0.0001234567890123456789012345).toPrecision(17) is "0.00012345678901234567" PASS Number(0.0001234567890123456789012345).toPrecision(18) is "0.000123456789012345671" PASS Number(0.0001234567890123456789012345).toPrecision(19) is "0.0001234567890123456713" PASS Number(0.0001234567890123456789012345).toPrecision(20) is "0.00012345678901234567130" PASS Number(0.0001234567890123456789012345).toPrecision(21) is "0.000123456789012345671298" PASS Number(12345.67890123456789012345).toPrecision() is "12345.678901234567" PASS Number(12345.67890123456789012345).toPrecision(1) is "1e+4" PASS Number(12345.67890123456789012345).toPrecision(2) is "1.2e+4" PASS Number(12345.67890123456789012345).toPrecision(3) is "1.23e+4" PASS Number(12345.67890123456789012345).toPrecision(4) is "1.235e+4" PASS Number(12345.67890123456789012345).toPrecision(5) is "12346" PASS Number(12345.67890123456789012345).toPrecision(6) is "12345.7" PASS Number(12345.67890123456789012345).toPrecision(7) is "12345.68" PASS Number(12345.67890123456789012345).toPrecision(8) is "12345.679" PASS Number(12345.67890123456789012345).toPrecision(9) is "12345.6789" PASS Number(12345.67890123456789012345).toPrecision(10) is "12345.67890" PASS Number(12345.67890123456789012345).toPrecision(11) is "12345.678901" PASS Number(12345.67890123456789012345).toPrecision(12) is "12345.6789012" PASS Number(12345.67890123456789012345).toPrecision(13) is "12345.67890123" PASS Number(12345.67890123456789012345).toPrecision(14) is "12345.678901235" PASS Number(12345.67890123456789012345).toPrecision(15) is "12345.6789012346" PASS Number(12345.67890123456789012345).toPrecision(16) is "12345.67890123457" PASS Number(12345.67890123456789012345).toPrecision(17) is "12345.678901234567" PASS Number(12345.67890123456789012345).toPrecision(18) is "12345.6789012345671" PASS Number(12345.67890123456789012345).toPrecision(19) is "12345.67890123456709" PASS Number(12345.67890123456789012345).toPrecision(20) is "12345.678901234567093" PASS Number(12345.67890123456789012345).toPrecision(21) is "12345.6789012345670926" PASS Number(-.0000000012345).toPrecision(2) is "-1.2e-9" PASS Number(-.000000012345).toPrecision(2) is "-1.2e-8" PASS Number(-.00000012345).toPrecision(2) is "-1.2e-7" PASS Number(-.0000012345).toPrecision(2) is "-0.0000012" PASS Number(-.000012345).toPrecision(2) is "-0.000012" PASS Number(-.00012345).toPrecision(2) is "-0.00012" PASS Number(-.0012345).toPrecision(2) is "-0.0012" PASS Number(-.012345).toPrecision(2) is "-0.012" PASS Number(-.12345).toPrecision(2) is "-0.12" PASS Number(-1.2345).toPrecision(2) is "-1.2" PASS Number(-12.345).toPrecision(2) is "-12" PASS Number(-123.45).toPrecision(2) is "-1.2e+2" PASS Number(-1234.5).toPrecision(2) is "-1.2e+3" PASS Number(-12345).toPrecision(2) is "-1.2e+4" PASS Number(-12345.67).toPrecision(4) is "-1.235e+4" PASS Number(-12344.67).toPrecision(4) is "-1.234e+4" PASS Number(-0.0001234567890123456789012345).toPrecision() is "-0.00012345678901234567" PASS Number(-0.0001234567890123456789012345).toPrecision(1) is "-0.0001" PASS Number(-0.0001234567890123456789012345).toPrecision(2) is "-0.00012" PASS Number(-0.0001234567890123456789012345).toPrecision(3) is "-0.000123" PASS Number(-0.0001234567890123456789012345).toPrecision(4) is "-0.0001235" PASS Number(-0.0001234567890123456789012345).toPrecision(5) is "-0.00012346" PASS Number(-0.0001234567890123456789012345).toPrecision(6) is "-0.000123457" PASS Number(-0.0001234567890123456789012345).toPrecision(7) is "-0.0001234568" PASS Number(-0.0001234567890123456789012345).toPrecision(8) is "-0.00012345679" PASS Number(-0.0001234567890123456789012345).toPrecision(9) is "-0.000123456789" PASS Number(-0.0001234567890123456789012345).toPrecision(10) is "-0.0001234567890" PASS Number(-0.0001234567890123456789012345).toPrecision(11) is "-0.00012345678901" PASS Number(-0.0001234567890123456789012345).toPrecision(12) is "-0.000123456789012" PASS Number(-0.0001234567890123456789012345).toPrecision(13) is "-0.0001234567890123" PASS Number(-0.0001234567890123456789012345).toPrecision(14) is "-0.00012345678901235" PASS Number(-0.0001234567890123456789012345).toPrecision(15) is "-0.000123456789012346" PASS Number(-0.0001234567890123456789012345).toPrecision(16) is "-0.0001234567890123457" PASS Number(-0.0001234567890123456789012345).toPrecision(17) is "-0.00012345678901234567" PASS Number(-0.0001234567890123456789012345).toPrecision(18) is "-0.000123456789012345671" PASS Number(-0.0001234567890123456789012345).toPrecision(19) is "-0.0001234567890123456713" PASS Number(-0.0001234567890123456789012345).toPrecision(20) is "-0.00012345678901234567130" PASS Number(-0.0001234567890123456789012345).toPrecision(21) is "-0.000123456789012345671298" PASS Number(-12345.67890123456789012345).toPrecision() is "-12345.678901234567" PASS Number(-12345.67890123456789012345).toPrecision(1) is "-1e+4" PASS Number(-12345.67890123456789012345).toPrecision(2) is "-1.2e+4" PASS Number(-12345.67890123456789012345).toPrecision(3) is "-1.23e+4" PASS Number(-12345.67890123456789012345).toPrecision(4) is "-1.235e+4" PASS Number(-12345.67890123456789012345).toPrecision(5) is "-12346" PASS Number(-12345.67890123456789012345).toPrecision(6) is "-12345.7" PASS Number(-12345.67890123456789012345).toPrecision(7) is "-12345.68" PASS Number(-12345.67890123456789012345).toPrecision(8) is "-12345.679" PASS Number(-12345.67890123456789012345).toPrecision(9) is "-12345.6789" PASS Number(-12345.67890123456789012345).toPrecision(10) is "-12345.67890" PASS Number(-12345.67890123456789012345).toPrecision(11) is "-12345.678901" PASS Number(-12345.67890123456789012345).toPrecision(12) is "-12345.6789012" PASS Number(-12345.67890123456789012345).toPrecision(13) is "-12345.67890123" PASS Number(-12345.67890123456789012345).toPrecision(14) is "-12345.678901235" PASS Number(-12345.67890123456789012345).toPrecision(15) is "-12345.6789012346" PASS Number(-12345.67890123456789012345).toPrecision(16) is "-12345.67890123457" PASS Number(-12345.67890123456789012345).toPrecision(17) is "-12345.678901234567" PASS Number(-12345.67890123456789012345).toPrecision(18) is "-12345.6789012345671" PASS Number(-12345.67890123456789012345).toPrecision(19) is "-12345.67890123456709" PASS Number(-12345.67890123456789012345).toPrecision(20) is "-12345.678901234567093" PASS Number(-12345.67890123456789012345).toPrecision(21) is "-12345.6789012345670926" PASS Number(0).toPrecision() is "0" PASS Number(0).toPrecision(1) is "0" PASS Number(0).toPrecision(2) is "0.0" PASS Number(0).toPrecision(3) is "0.00" PASS Number(0).toPrecision(4) is "0.000" PASS Number(0).toPrecision(5) is "0.0000" PASS Number(0).toPrecision(6) is "0.00000" PASS Number(0).toPrecision(7) is "0.000000" PASS Number(0).toPrecision(8) is "0.0000000" PASS Number(0).toPrecision(9) is "0.00000000" PASS Number(0).toPrecision(10) is "0.000000000" PASS Number(0).toPrecision(11) is "0.0000000000" PASS Number(0).toPrecision(12) is "0.00000000000" PASS Number(0).toPrecision(13) is "0.000000000000" PASS Number(0).toPrecision(14) is "0.0000000000000" PASS Number(0).toPrecision(15) is "0.00000000000000" PASS Number(0).toPrecision(16) is "0.000000000000000" PASS Number(0).toPrecision(17) is "0.0000000000000000" PASS Number(0).toPrecision(18) is "0.00000000000000000" PASS Number(0).toPrecision(19) is "0.000000000000000000" PASS Number(0).toPrecision(20) is "0.0000000000000000000" PASS Number(0).toPrecision(21) is "0.00000000000000000000" PASS successfullyParsed is true TEST COMPLETE