Conversion from negative float to unsigned int

Fred Tydeman uunet!ibminet.awdpa.ibm.com!ibmpa!tydeman
Mon Mar 15 10:25:35 PST 1993


What is the result of assigning the negative floating point value (-1.0)
to unsigned char, unsigned short, unsigned int, and unsigned long?
 
Is the result 0, +1, the value with all bits on (UCHAR_MAX, USHRT_MAX,
UINT_MAX, and ULONG_MAX), or something else?
 
ANSI C 3.2.1.3 Floating and Integral and footnote 29 on page 36 are not
very clear.
 
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