Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ status87(DOS) — System V/386 Software Development System 3.2.2b

Media Vault

Software Library

Restoration Projects

Artifacts Sought

     Name
          _status87 - Gets floating-point status word.

     Syntax
          #include <float.h>

          unsigned int _status87( )

     Description
          The _status87 function gets the floating-point status word.
          The status word is a combination of the 8087/80287/80387
          status word and other conditions detected by the
          8087/80287/80387 exception handler, such as floating-point
          stack overflow and underflow.

     Return Value
          The bits in the value returned indicate the floating-point
          status. See the float.h include file for a complete
          definition of the bits returned by _status87.

     Notes
          Many of the math library functions modify the
          8087/80287/80387 status word, with unpredictable results.
          Return values from _clear87 and _status87 become more
          reliable as fewer floating-point operations are performed
          between known states of the floating-point status word.

     See Also
          _clear87(DOS), _control87(DOS)

     Example
          #include <stdio.h> #include <float.h>

          double a = 1e-40, b; float x, y;

          main()
           {
                  printf("Status = %.4x - clear\n",_status87());

                  /* Store into y is inexact & underflows: */
                  y = a;
                  printf("Status = %.4x - inexact, underflow\n",
                          _status87());

                  /* y is denormal: */
                  b = y;
                  printf("Status = %.4x - inexact underflow,")
                  printf(" denormal\n", _status87());

                  /* Clear user 8087: */
                  _clear87();
           }

          This program creates various floating-point errors and then
          uses _status87 to display messages indicating these
          problems.

                                                (printed 6/18/89)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026