Files
wren/test/core/number/mod.wren
T

18 lines
434 B
Plaintext
Raw Normal View History

2014-01-05 12:27:12 -08:00
IO.print(5 % 3) // expect: 2
IO.print(10 % 5) // expect: 0
IO.print(-4 % 3) // expect: -1
IO.print(4 % -3) // expect: 1
IO.print(-4 % -3) // expect: -1
IO.print(-4.2 % 3.1) // expect: -1.1
IO.print(4.2 % -3.1) // expect: 1.1
IO.print(-4.2 % -3.1) // expect: -1.1
2013-11-09 21:01:18 -08:00
// Left associative.
2014-01-05 12:27:12 -08:00
IO.print(13 % 7 % 4) // expect: 2
2013-11-09 21:01:18 -08:00
2015-01-22 09:49:43 +13:00
// Precedence.
IO.print(13 + 1 % 7) // expect: 14
// TODO: Unsupported RHS types.
// TODO: Error on mod by zero.