File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 3737
3838/*
3939 TODO:
40- - test n_digits=101 instead of 100
4140 - simplify subnormal handling
4241 - reduce max memory usage
4342 - free format: could add shortcut if exact result
Original file line number Diff line number Diff line change @@ -442,6 +442,15 @@ function test_number()
442442
443443 assert ( ( 1.3 ) . toString ( 7 ) , "1.2046204620462046205" ) ;
444444 assert ( ( 1.3 ) . toString ( 35 ) , "1.ahhhhhhhhhm" ) ;
445+
446+ assert ( ( 123.456 ) . toExponential ( 100 ) ,
447+ "1.2345600000000000306954461848363280296325683593750000000000000000000000000000000000000000000000000000e+2" ) ;
448+ assert ( ( 1.23e-99 ) . toExponential ( 100 ) ,
449+ "1.2299999999999999636794326616259654935901564299639709630577493044757187515388707554223010856511630028e-99" ) ;
450+ assert ( ( - 0.0007 ) . toExponential ( 100 ) ,
451+ "-6.9999999999999999288763374849509091291110962629318237304687500000000000000000000000000000000000000000e-4" ) ;
452+ assert ( ( 0 ) . toExponential ( 100 ) ,
453+ "0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+0" ) ;
445454}
446455
447456function test_eval2 ( )
You can’t perform that action at this time.
0 commit comments