RosettaCodeData/Task/Literals-Integer/Ruby/literals-integer.rb

7 lines
220 B
Ruby

727 == 0b1011010111 # => true, binary
727 == 0x2d7 # => true, hex
727 == 0o1327 # => true, octal
727 == 01327 # => true, octal
12345 == 12_345 # => true underscores are ignored; useful for keeping track of places