Files
wren/test/core/number/truncate.wren
T
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

14 lines
562 B
Plaintext

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.123.truncate) // expect: 0
IO.print(12.3.truncate) // expect: 12
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