Literals/Integer: Difference between revisions
Content added Content deleted
Line 369: | Line 369: | ||
Bases from 2 to 36 are allowed in Frink. All literals can be arbitrarily large. Frink does not subscribe to the insanity that a leading 0 implies octal. |
Bases from 2 to 36 are allowed in Frink. All literals can be arbitrarily large. Frink does not subscribe to the insanity that a leading 0 implies octal. |
||
<lang frink> |
<lang frink> |
||
123456789123456789 // (a number in base 10) |
|||
123_456_789_123_456_789 // (the same number in base 10 with underscores for readability) |
|||
1 quadrillion // (named numbers are fine in Frink.) |
|||
1ee39 // (exact exponent, an integer with exact value 10^39) |
|||
100001000101111111101101\\2 // (a number in base 2) |
100001000101111111101101\\2 // (a number in base 2) |
||
1000_0100_0101_1111_1110_1101\\2 // (a number in base 2 with underscores for readability) |
1000_0100_0101_1111_1110_1101\\2 // (a number in base 2 with underscores for readability) |