Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: C User's Guide Oracle Solaris Studio 12.3 Information Library |
1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
2.3 Thread Local Storage Specifier
2.6.1 Printing long long Data Types
2.6.2 Usual Arithmetic Conversions
2.7 Case Ranges in Switch Statements
2.11.3 does_not_read_global_data
2.11.5 does_not_write_global_data
2.11.26 warn_missing_parameter_info
2.13 Preserving the Value of errno
2.14.3 __inline and __inline__
2.14.5 __FUNCTION__ and __PRETTY_FUNCTION__
2.16 How to Specify Include Files
2.16.1 Using the -I- Option to Change the Search Algorithm
2.17 Compiling in Free-Standing Environments
2.18 Compiler Support for Intel MMX and Extended x86 Platform Intrinsics
7. Converting Applications for a 64-Bit Environment
8. cscope: Interactively Examining a C Program
A. Compiler Options Grouped by Functionality
B. C Compiler Options Reference
C. Implementation-Defined ISO/IEC C99 Behavior
E. Implementation-Defined ISO/IEC C90 Behavior
H. Oracle Solaris Studio C: Differences Between K&R C and ISO C
This section provides a summary of IEEE 754 floating-point default arithmetic, which is “nonstop.” Underflows are “gradual.” For more detailed information, see the Numerical Computation Guide.
Nonstop means that execution does not halt on occurrences like division by zero, floating-point overflow, or invalid operation exceptions. For example, consider the following, where x is zero and y is positive:
z = y / x;
By default, z is set to the value +Inf, and execution continues. With the -fnonstd option, however, this code causes an exit, such as a core dump.
The following example shows how gradual underflow works. Suppose you have the following code:
x = 10; for (i = 0; i < LARGE_NUMBER; i++) x = x / 10;
The first time through the loop, x is set to 1; the second time to 0.1; the third time to 0.01; and so on. Eventually, x reaches the lower limit of the machine’s capacity to represent its value. What happens the next time the loop runs?
Say that the smallest number characterizable is 1.234567e-38
The next time the loop runs, the number is modified by “stealing” from the mantissa and “giving” to the exponent so the new value is 1.23456e-39 and, subsequently, 1.2345e-40 and so on. This behavior is known as “gradual underflow,” and is the default. In nonstandard mode, none of this “stealing” takes place, and x is simply set to zero.