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

18 lines
474 B
Plaintext
Raw Normal View History

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