Numbers

DinoCode works with various numeric formats.

Common types#

TypeExampleUse
Integer42, -100Without decimals
Float3.14, 22.4With decimals
Scientific notation1.5e3, 2.5e-2Equivalent to 1500 and 0.025
Hexadecimal0xFFBase 16 (prefix 0x)
Binary0b1010Base 2 (prefix 0b)
BigInt1000n, 0xFFnVery large numbers (suffix n)
x = 10
y = 22.4
print x + y        # 32.4
print 0xFF         # 255
print 0b1010       # 10
print 1.5e3        # 1500

large = 1000000000000000044400000000000000000055550000000n
print large
BigInt

Use the suffix n when a normal integer does not reach the precision you need.