blob: 1b32d4b336b4165712a94e919757a81895613510 [file] [log] [blame]
This test checks for accuracy in numeric conversions, particularly with large or infinite values.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Number(1152921504606847105).toString() is '1152921504606847200'
PASS parseInt('1152921504606847105').toString() is '1152921504606847200'
PASS (- (- '1152921504606847105')).toString() is '1152921504606847200'
PASS Number(0x1000000000000081).toString(16) is '1000000000000100'
PASS parseInt('0x1000000000000081', 16).toString(16) is '1000000000000100'
PASS (- (- '0x1000000000000081')).toString(16) is '1000000000000100'
PASS Number(0100000000000000000201).toString(8) is '100000000000000000400'
PASS parseInt('100000000000000000201', 8).toString(8) is '100000000000000000400'
PASS (- 'infinity').toString() is 'NaN'
PASS parseInt('1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000').toString() is 'Infinity'
PASS parseInt('0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 16).toString() is 'Infinity'
PASS parseInt('100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 8).toString() is 'Infinity'
PASS parseInt('9007199254740992e2000').toString() is '9007199254740992'
PASS parseInt('9007199254740992.0e2000').toString() is '9007199254740992'
PASS parseInt(NaN) is NaN
PASS parseInt(-Infinity) is NaN
PASS parseInt(Infinity) is NaN
PASS parseInt(-0.6).toString() is '0'
PASS successfullyParsed is true
TEST COMPLETE