printf( "%#04x", 1 )

Fred Tydeman uunet!ibmpa.awdpa.ibm.com!tydeman
Fri Feb 25 07:44:29 PST 1994


Subject: printf( "%#04x", 1 );
 
What string should be output by the above:
1) 0x01
2) 0x0001
3) Something else
 
In other words, is the '0x' counted in the field width?  If it is, then
the output is 0x01.  If it is not, then the output is 0x0001.  Current
vendors do it both ways.
 
These are not IBM's views, these are the personal ones of:
Fred Tydeman, IBM, Austin, Texas (512) 838-3322; fax (512) 838-3484
AIX S/6000 Math library architect & IBM's rep to NCEG (X3J11.1)
Internet: tydemanaibmpa.awdpa.ibm.com    uucp: uunet!ibmsupt!tydeman



More information about the Numeric-interest mailing list