diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-12 13:09:31 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-12 13:09:31 -0400 |
| commit | 6c01eef851439549018267fdc439e4884af0c624 (patch) | |
| tree | 0599dd071b8a5effb67e6a87ed1c34777eb8d8c7 /test/integers.tm | |
| parent | 17cb6ffd88c4464c513b045f4b06c4e6e46e8f22 (diff) | |
Introducing the main() function
Diffstat (limited to 'test/integers.tm')
| -rw-r--r-- | test/integers.tm | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/test/integers.tm b/test/integers.tm index a3ec7fe2..376e0319 100644 --- a/test/integers.tm +++ b/test/integers.tm @@ -1,55 +1,55 @@ +func main() + >> 2 + 3 + = 5 ->> 2 + 3 -= 5 + >> 2 * 3 + = 6 ->> 2 * 3 -= 6 + >> 2 + 3 * 4 + = 14 ->> 2 + 3 * 4 -= 14 + >> 2 * 3 + 4 + = 10 ->> 2 * 3 + 4 -= 10 + >> 1i8 + 2i16 + = 3_i16 ->> 1i8 + 2i16 -= 3_i16 + >> 2 ^ 10 + = 1024 : Num ->> 2 ^ 10 -= 1024 : Num + >> 3 and 2 + = 2 ->> 3 and 2 -= 2 + >> 3 or 4 + = 7 ->> 3 or 4 -= 7 + >> 3 xor 2 + = 1 ->> 3 xor 2 -= 1 + nums := "" + for x in 5 + nums ++= "{x}," + >> nums + = "1,2,3,4,5," -nums := "" -for x in 5 - nums ++= "{x}," ->> nums -= "1,2,3,4,5," + >> x := 123 + >> x:format(digits=5) + = "00123" + >> x:hex() + = "0x7B" + >> x:octal() + = "0o173" ->> x := 123 ->> x:format(digits=5) -= "00123" ->> x:hex() -= "0x7B" ->> x:octal() -= "0o173" + >> Int.random() + >> Int.min + = -9223372036854775808 + >> Int.max + = 9223372036854775807 ->> Int.random() ->> Int.min -= -9223372036854775808 ->> Int.max -= 9223372036854775807 - ->> 123_i32:hex() -= "0x7B" ->> 123_i16:hex() -= "0x7B" ->> 123_i8:hex() -= "0x7B" + >> 123_i32:hex() + = "0x7B" + >> 123_i16:hex() + = "0x7B" + >> 123_i8:hex() + = "0x7B" |
