How can I compute the range of signed and unsigned types
Walter B. Ligon III
walt at clemson.edu
Wed Apr 18 13:09:14 EDT 2001
> Just out of curiosity, are there any machines currently is use that do=20
> NOT use two's complement? Do IEEE or C standards say anything about the=20
> size of the mantissa in floats?
The early Crays were famous for using 1's complement, but other than that
most current machines *I* have heard of use 2's complement.
IEEE standard DOES specify bits and formats used in floats, but there ARE
current machines that use alternative FP formats. The Alpha provides
DEC FP format capability (though it ALSO has IEEE, and probably uses that
exclusively at least with GCC). The Vax isn't really current, so I guess
it doesn't count. Not sure about other machines.
if you assume 2's comp and IEEE floating point, then the issue of range
comes down to a few well defined formats, and so the entries in limits.h
are to be trusted, because they haven't changed in quite some time. its
only if you want to deal with odd formats that ranges become sticky.
for example we build math hardware in FPGAs and data ranges and formats
are a BIG deal. Not much of an issue with Intel Pentiums.
Now byte order THERE is an issue that will NEVER go away!!!
Dr. Walter B. Ligon III
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
More information about the Beowulf