Fix #31. Bitwise operators on numbers.

This commit is contained in:
Bob Nystrom
2014-02-24 07:27:43 -08:00
parent 161075affe
commit 44e68a5db9
5 changed files with 48 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
IO.print(0 | 0) // expect: 0
IO.print(2863311530 | 1431655765) // expect: 4294967295
IO.print(3435973836 | 1717986918) // expect: 4008636142
// Max u32 value.
IO.print(4294967295 | 4294967295) // expect: 4294967295
// Past max u32 value.
IO.print(4294967296 | 4294967296) // expect: 0
// TODO: Negative numbers.
// TODO: Floating-point numbers.