Next: Strings, Previous: Atoms, Up: Data constants [Contents][Index]
The available range of integers is -(2^31-1)
to 2^31-1
on a 32 bit machine and -(2^63-1)
to 2^63-1
on a 64 bit machine. Integers can be represented in any of the following ways.
For example:
123
Base
’Number
, where Base
ranges from 2 to 36 and Number
can have any sequence of alphanumeric characters. Both upper and lower case alphabetic characters in Number
are used to represent the appropriate digit when Base
is greater than 10.2'1010 16'A 16'a
0b
followed by binary digits. Similarly octal and hexadecimal numbers can be represented by 0o
or 0x
followed by digits.0b1011 0o3170 0x3afd
Character
gives the character code of Character
.0'A
gives the ASCII character code 65.
A natural number is a non-negative integer.
num
type numbers include double precision floating point numbers. They are represented using either a decimal point or scientific e notation. Examples:
27.8 1.896e4