HP-UX Floating-Point Guide

Chapter 2 65
Floating-Point Principles and the IEEE Standard for Binary Floating-Point Arithmetic
Floating-Point Operations
Decimal to Single-Precision,
Double-Precision, or
Quad-Precision These conversions can overflow or
underflow and are usually inexact.
See “Conversions Between Binary
and Decimal” on page 76 for more
information about these conversions.
Single-Precision,
Double-Precision, or
Quad-Precision to Decimal These conversions can overflow or
underflow and are usually inexact.
See “Conversions Between Binary
and Decimal” on page 76 for more
information about these conversions.
Single-Precision,
Double-Precision, or
Quad-Precision to Integer These conversions are usually
inexact. Out-of-range finite values,
infinities, and NaNs cause an invalid
operation exception. The overflow
and underflow exceptions do not
apply to these conversions. Results
that are too small to round up to one
round down to zero. Signed zeros
become integer zeros.
HP 9000 systems round these
conversions in accordance with IEEE
rounding rules. However, some
programming languages, such as C,
require that these conversions be
performed with truncation. See
“Truncation to an Integer Value” on
page 92 for information about
problems that can result when
floating-point values are truncated to
integer.
Integer to Quad-Precision These conversions are always exact
and never generate an exception.