Skip to content

Commit

Permalink
Add more tests of parsing large floating point numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonAndre committed Oct 2, 2022
1 parent fa24e06 commit bf7357c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/decode_integer_overflow.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ dump_result('18446744073709551616.0');
dump_result('-9223372036854775808');
dump_result('-9223372036854775809');
dump_result('-9223372036854775809.0');
dump_result('4000000000000000000000000000000000000000000000000000000');
dump_result('4000000000000000000000000000000000000000000000000000000.1');
dump_result('4000000000000000000000000000000000000000000000000000000E1');
dump_result('4' . str_repeat('0', 305));
dump_result('4' . str_repeat('0', 309));
dump_result('1e307');
dump_result('1e309');
dump_result('1e309');
Expand Down Expand Up @@ -63,6 +68,16 @@ Testing '-9223372036854775809'
float(-9223372036854775808)
Testing '-9223372036854775809.0'
float(-9223372036854775808)
Testing '4000000000000000000000000000000000000000000000000000000'
float(4.0000000000000003132E+54)
Testing '4000000000000000000000000000000000000000000000000000000.1'
float(4.0000000000000003132E+54)
Testing '4000000000000000000000000000000000000000000000000000000E1'
float(4.0000000000000000409E+55)
Testing '400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
float(3.999999999999999757E+305)
Testing '4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
float(INF)
Testing '1e307'
float(9.9999999999999998603E+306)
Testing '1e309'
Expand Down

0 comments on commit bf7357c

Please sign in to comment.