Number
Numbers are a way to represent any ordinal limited by your computer's memory.
Cheddar's numbers support decimals, separators, bases, and implicit promotion.
Basic Numbers
The most basic form of a number in Cheddar are integers and decimals. Cheddar wraps both of these in a "Number" type. You can write numbers as you would in most languages:
Separators
Often in programs you deal with large numbers. Numbers are often written with commas to distinguish the sections of the number. Cheddar provides a simple syntax for number separators, _
.
As you can see, Cheddar does not enforce where you place your number separators.
Bases
You can type binary, octal, and hexadecimal literals in Cheddar:
What's the zero at the beginning? That specified the amount of zeros to append to the integer section of the number. For example:
Last updated