Talk:0x
Latest comment: 10 years ago by Kephir
This is not specific to any one programming language. Does anyone know the "etymology"? Did it originate in C? Equinox ◑ 10:14, 7 October 2011 (UTC)
- Theory: x stands for hex (sort of phonetically) and the prefix x would make an identifier in C, so it was necessary to add a digit before it. Can anyone confirm/deny? Equinox ◑ 22:39, 17 January 2012 (UTC)
- Very probably so. I looked for documentation of C's contemporaries and none of them seemed to have this prefix before; PL/I suffixed hexadecimal literals with
XN
orXU
, ALGOL 68 prefixed them with16r
[1], VAX assembly with "^X
"[2], while B, PDP-11 assembly[3]and FORTRANhad no notation for them at all (the "Z" prefix seems to have appeared in FORTRAN 77, later than K&R C). B prefixed octal literals with a '0'. Either way, this seems to originate in C, so I am adding it. — Keφr 17:42, 16 May 2014 (UTC)
- Very probably so. I looked for documentation of C's contemporaries and none of them seemed to have this prefix before; PL/I suffixed hexadecimal literals with