Most languages (Ruby included) allow number literals to be written in at least three bases: decimal, octal and hexadecimal. Numbers in decimal base is the usual thing and are written as (most) people naturally write numbers, 96 is written as 96
. Numbers prefixed by a zero are usually interpreted as octal based: 96 would be written as 0140
. Hexadecimal based numbers are usually prefixed by 0x
: 96 would be written as 0x60
.
The question is: can I write numbers as binary literals in Ruby? How?