If 0o is for octal, and 0x is for hex....

Is there one for representing binary annotation in text form?

Posted Dec 16, 2017, 7:08 PM UTC

25
lightcloud5•

Some languages use 0b for binary. That said, binary numbers are also relatively easily represented in hex, since each hexadecimal digit is just 4 binary digits.

6
Holy_City•

0xABC = 0o37 47 57 = 0b1010 1011 1100

Alternatively

ABCx = 37 47 57o = 1010 1011 1100b

Although who uses octal today, honestly? I don't think I've ever seen it outside a classroom.

2
raevnos•

Unix file permissions, and as '\0' in C are the only places I see octal used.

2
Shark1221•

0x is hex 0b is binary

2