Talk:0x

From Wiktionary, the free dictionary
Latest comment: 10 years ago by Kephir
Jump to navigation Jump to search

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)Reply

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)Reply
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 or XU, ALGOL 68 prefixed them with 16r[1], VAX assembly with "^X"[2], while B, PDP-11 assembly[3] and FORTRAN had 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)Reply