RosettaCodeData/Task/Literals-Integer/EMal/literals-integer.emal

17 lines
364 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
^|
| EMal internally uses 64 bit signed integers.
|^
2026-04-30 12:34:36 -04:00
int hex ← 0xff # base16
int oct ← 0o377 # base8
int bin ← 0b11111111 # base2
int dec ← 255 # base10
2023-07-01 11:58:00 -04:00
writeLine(hex)
writeLine(oct)
writeLine(bin)
writeLine(dec)
# here we check that they give the same value
2026-04-30 12:34:36 -04:00
writeLine(0b1011010111 æ 0o1327 and
0o1327 æ 0x2d7 and
0x2d7 æ 727 and
727 æ 0b1011010111)