Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
28 - 1
28
Using Floating-Point Formats
In the G07 and later versions of the NonStop operating system, users have the option
of choosing between using HP floating-point format and IEEE floating-point format in
their native C and C++ programs for performing floating-point arithmetic. Choosing HP
floating-point format provides compatibility with pre-G07 C and C++ applications.
Choosing IEEE floating-point format allows your application to take advantage of the
greater performance provided by the floating-point instructions available in some CPU
hardware.
HP floating-point format is supported in software millicode while IEEE floating-point
format is supported in the CPU hardware. IEEE floating-point format is an industry-
standard data format. HP floating-point format is HP’s implementation of floating-point
arithmetic. Thus, the data format is different between the two floating-point options.
Data interchange with systems other than HP systems is easier with IEEE floating-
point format than with Tandem floating-point format. For data interchange from one
format to another, users need to call conversion routines. Tandem floating-point format
is available for TNS C and C++, FORTRAN, TAL, pTAL, Pascal, COBOL85, native C
and C++ programs. IEEE floating-point format is available only for native C and C++
programs.
This section discusses the following topics:
Differences between Tandem floating-point format and IEEE floating-point format
Building and running IEEE floating-point programs
Compiling and linking IEEE floating-point programs
Link-time and run-time validity checking
Run-time support and debugging options
Conversion and operating mode routines
Considerations
Differences Between Tandem and IEEE Floating-Point Formats
IEEE and Tandem floating-point data formats have different range of values and
different precisions.
IEEE and Tandem floating-point data formats have different internal layouts (for
example, the exponents are in different bit fields).
IEEE floating-point format is faster than Tandem floating-point format.
IEEE floating-point format is easier for porting applications.
IEEE floating-point default handling of overflow, underflow, divide-by-zero, and
invalid operation is better than the Tandem floating-point handling.