GNU Info

Info Node: (g77-295.info)Floating-point precision

(g77-295.info)Floating-point precision


Next: Inconsistent Calling Sequences Prev: Large File Unit Numbers Up: Working Programs
Enter node , (file) or (file)node

Floating-point precision
------------------------

   If your program depends on exact IEEE 754 floating-point handling it
may help on some systems--specifically x86 or m68k hardware--to use the
`-ffloat-store' option or to reset the precision flag on the
floating-point unit.  Note: Optimize Options.

   However, it might be better simply to put the FPU into double
precision mode and not take the performance hit of `-ffloat-store'.  On
x86 and m68k GNU systems you can do this with a technique similar to
that for turning on floating-point exceptions (Note: Floating-point
Exception Handling.).  The control word could be set to double
precision by replacing the `__setfpucw' call or the `_FPU_SETCW' macro
with one like this:
     {
       fpu_control_t cw = (_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE;
       _FPU_SETCW(cw);
     }
   (It is not clear whether this has any effect on the operation of the
GNU maths library, but we have no evidence of it causing trouble.)

   Some targets (such as the Alpha) may need special options for full
IEEE conformance.  *Note Hardware Models and Configurations:
(gcc)Submodel Options.


automatically generated by info2www version 1.2.2.9