Saturday, May 23, 2009

The direction of truncation or rounding when a floating-point number

The value is rounded to the nearest representable value. Ties are broken
according to the rules of IEEE standard arithmetic.
3.3 The results of bitwise operations on signed integers.
The bitwise operators apply to signed integers as if they were their
corresponding unsigned types. The sign bit is treated as a normal data
bit. The result is then interpreted as a normal 2's complement signed
integer.
3.3.2.3 What happens when a member of a union object is accessed using a
member of a different type.
The access is allowed and will simply access the bits stored there.
You'll need a detailed understanding of the bit encodings of floating-point
values in order to understand how to access a floating-type member using a
different member. If the member stored is shorter than the member used to
access the value, the excess bits have the value they had before the short
member was stored.

No comments:

Post a Comment