fix: correct fraction and truncate test expectations for negative zero and large values
- Update fraction.wren test to cover edge cases for negative zero, small fractions, and large mantissa approximations - Fix truncate.wren expected output for negative zero cases from 0 to -0 - Add truncate tests for large 32-bit representation values with approximation notes
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
IO.print(123.truncate) // expect: 123
|
||||
IO.print((-123).truncate) // expect: -123
|
||||
IO.print(0.truncate) // expect: 0
|
||||
IO.print((-0).truncate) // expect: 0
|
||||
IO.print((-0).truncate) // expect: -0
|
||||
IO.print(0.123.truncate) // expect: 0
|
||||
IO.print(12.3.truncate) // expect: 12
|
||||
IO.print((-0.123).truncate) // expect: 0
|
||||
IO.print((-0.123).truncate) // expect: -0
|
||||
IO.print((-12.3).truncate) // expect: -12
|
||||
|
||||
// Using 32-bit representation, values "beyond" those two will lead to
|
||||
// approximation.
|
||||
IO.print((12345678901234.5).truncate) // expect: 12345678901234
|
||||
IO.print((-12345678901234.5).truncate) // expect: -12345678901234
|
||||
|
||||
Reference in New Issue
Block a user