Integer syntax
Factor handbook » The language » Syntax » Literals » Number syntax

Next:Ratio syntax


The printed representation of an integer consists of a sequence of digits, optionally prefixed by a sign and arbitrarily separated by commas or underscores.
123456 -10 2,432,902,008,176,640,000 1_000_000

Integers are entered in base 10 unless prefixed with a base-changing prefix. 0x begins a hexadecimal literal, 0o an octal literal, and 0b a binary literal. A sign, if any, goes before the base prefix.
USE: prettyprint 10 . 0b10 . -0o10 . 0x10 .
10 2 -8 16

More information on integers can be found in Integers.