HP-UX Floating-Point Guide
6
Contents
Floating-Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Conversion Between Operand Formats. . . . . . . . . . . . . . . . . . . . . . . . 64
The Remainder Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Recommended Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3. Factors that Affect the Results of Floating-Point Computations
How Basic Operations Affect Application Results . . . . . . . . . . . . . . . . . 71
How Mathematical Library Functions Affect Application Results . . . . 73
How Exceptions and Library Errors Affect Application Results. . . . . . 74
Other System-Related Factors that Affect Application Results . . . . . . 76
Conversions Between Binary and Decimal . . . . . . . . . . . . . . . . . . . . . 76
Compiler Behavior and Compiler Version . . . . . . . . . . . . . . . . . . . . . . 78
Compiler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Architecture Type of Run-Time System. . . . . . . . . . . . . . . . . . . . . . . . 80
Operating System Release of Build-Time System. . . . . . . . . . . . . . . . 81
Operating System Release of Run-Time System. . . . . . . . . . . . . . . . . 81
Values of Certain Modifiable Hardware Status Register Fields. . . . . 82
Floating-Point Coding Practices that Affect Application Results . . . . . 83
Testing Floating-Point Values for Equality. . . . . . . . . . . . . . . . . . . . . 84
Taking the Difference of Similar Values . . . . . . . . . . . . . . . . . . . . . . . 87
Adding Values with Very Different Magnitudes . . . . . . . . . . . . . . . . . 88
Unintentional Underflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Truncation to an Integer Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Ill-Conditioned Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94