Files
wren/test/number/bitwise_not.wren
T
Bob Nystrom c72db7d594 feat: rename IO.write to IO.print and add Unicode escape support in strings
Rename the IO.write method to IO.print, which now prints without a trailing newline, and add a new IO.print method that appends a newline after output. Update all benchmark, example, and test files to use IO.print instead of IO.write. Additionally, implement Unicode escape sequence parsing in the compiler's string tokenizer, supporting \uXXXX and \u{...} syntax with proper UTF-8 encoding for code points up to U+10FFFF.
2014-01-05 20:27:12 +00:00

23 lines
621 B
Plaintext

IO.print(~0) // expect: 4294967295
IO.print(~1) // expect: 4294967294
IO.print(~23) // expect: 4294967272
// Max u32 value.
IO.print(~4294967295) // expect: 0
// Past max u32 value.
IO.print(~4294967296) // expect: 4294967295
// Negative numbers.
IO.print(~-1) // expect: 0
IO.print(~-123) // expect: 122
IO.print(~-4294967294) // expect: 4294967293
IO.print(~-4294967295) // expect: 4294967294
IO.print(~-4294967296) // expect: 4294967295
// Floating point values.
IO.print(~1.23) // expect: 4294967294
IO.print(~0.00123) // expect: 4294967295
IO.print(~345.67) // expect: 4294966950
IO.print(~-12.34) // expect: 11