3 ms·
0x1234 is hexadecimal. 1234 is decimal. 01234 is octal. 0b1011011101111 is binary. It's de-facto standard, especially in the UNIX world.
by jrockway 14y ago
0x1234 is hexadecimal. 1234 is decimal. 01234 is octal. 0b1011011101111 is binary. It's de-facto standard, especially in the UNIX world.
- gue5t 14y agoThe new wave for octal notation is 0o1234; it's supported by haskell and some others and seems much cleaner to my tastes.
- wmf 14y agoI was thinking more of the two dots instead of three. (Interestingly, RFC 791 does not define dotted-quad notation. It must have been added later.)
- gurkendoktor 14y agoIt's a standard that everyone knows because they have been bitten by it. :( I was curious about it being limited to the UNIX world, and indeed, C# is the only C-like language that does not have this feature. On the UNIX side, even Go decided to keep them [0]. Python dropped them in v3 but I'm not sure if that counts as a UNIXy language or not... [0] http://groups.google.com/group/golang-nuts/browse_thread/thread/c6cdb49ae7ccc8c6 http://groups.google.com/group/golang-nuts/browse_thread/thr...