In SAS, the LENGTH statement works by truncating the number of mantissa bits.
For more information about the effects of truncated lengths, see “Using the TRUNC
Function When Comparing Values” on page 79.
• bias – an offset used to enable both negative and positive exponents with the bias
representing 0. If a bias is not used, an additional sign bit for the exponent must be
allocated. For example, if a system uses a bias of 64, a characteristic with the value
66 represents an exponent of +2, whereas a characteristic of 61 represents an
exponent of –3.
Floating-Point Representation Using the IEEE Standard
The IEEE standard for floating-point arithmetic is a technical standard for floating-point
computation created by the Institute of Electrical and Electronic Engineers (IEEE). The
standard defines how computers store numbers in floating-point representation. The
IEEE standard for floating-point numbers is used by many operating systems, including
Windows and UNIX.
Although the IEEE platforms use the same set of specifications, you might occasionally
see varying results between the platforms due to compiler differences, and math library
differences. Also, because the IEEE standard allows for some variations in how the
standard is implemented, there might be differences in how different platforms perform
calculations even though they are following the same standard. Hosts might yield
different results because the underlying instructions that each operating system uses to
perform calculations are slightly different.
There is no standard method for performing computations. All operating systems attempt
to compute numbers as accurately as possible. It is not uncommon to get slightly
different results between operating systems whose floating-point representation
components differ. For example, there are differences between the z/OS and Windows
operating systems and between the z/OS and UNIX operating systems.
The IEEE standard for double-precision, floating-point numbers specifies an 11-bit
exponent with a base of 2 and a bias of 1023, which means that it has much greater
magnitude than the IBM mainframe representation, but sometimes at the expense of 3
bits less in the mantissa. The value of 1 represented by the IEEE standard is as follows:
3F F0 00 00 00 00 00 00
On Windows platforms, the processor performs computations in extended real precision.
This means that instead of the 64 bits that are used to store numeric values in the basic
format (52 bits for the mantissa and 11 bits for the exponent), there are 16 additional
bits: 12 additional bits for the mantissa and 4 additional bits for the exponent. Numeric
values are not stored in 80 bits (10 bytes) since the maximum width for a numeric
variable in SAS is 8 bytes. This simply means that the processor uses 80 bits to represent
a numeric value before it is passed back to its 64–bit memory slot. Intermediate
calculations might be done in 80 bits, which affects a part of the final answer.
On Windows this allows storage of numbers larger than the basic IEEE floating-point
format used by operating systems such as UNIX. This is one reason why you might see
slightly different values from operating systems that use the same IEEE standard.
Extended precision formats provide greater precision and more exponent range than the
basic floating-point formats.
66 Chapter 4 • SAS Variables