RosettaCodeData/Task/Literals-Integer/EMal/literals-integer.emal
2026-04-30 12:34:36 -04:00

16 lines
364 B
Text

^|
| EMal internally uses 64 bit signed integers.
|^
int hex ← 0xff # base16
int oct ← 0o377 # base8
int bin ← 0b11111111 # base2
int dec ← 255 # base10
writeLine(hex)
writeLine(oct)
writeLine(bin)
writeLine(dec)
# here we check that they give the same value
writeLine(0b1011010111 æ 0o1327 and
0o1327 æ 0x2d7 and
0x2d7 æ 727 and
727 æ 0b1011010111)