Back to index

glibc  2.9
Functions | Variables
qp_util.c File Reference
#include "soft-fp.h"

Go to the source code of this file.

Functions

double __Qp_handle_exceptions (int exceptions)

Variables

static unsigned long numbers []

Function Documentation

double __Qp_handle_exceptions ( int  exceptions)

Definition at line 32 of file qp_util.c.

{
  double d, *p = (double *)numbers;
  if (exceptions & FP_EX_INVALID)
    d = p[3]/p[3];
  if (exceptions & FP_EX_OVERFLOW)
    {
      d = p[0] + p[0];
      exceptions &= ~FP_EX_INEXACT;
    }
  if (exceptions & FP_EX_UNDERFLOW)
    {
      if (exceptions & FP_EX_INEXACT)
        {
         d = p[2] * p[2];
         exceptions &= ~FP_EX_INEXACT;
       }
      else
       d = p[1] - p[2];
    }
  if (exceptions & FP_EX_DIVZERO)
    d = 1.0/p[3];
  if (exceptions & FP_EX_INEXACT)
    d = p[0] - p[2];
  return d;
}

Variable Documentation

unsigned long numbers[] [static]
Initial value:
 {
0x7fef000000000000UL, 
0x0010100000000000UL, 
0x0010000000000000UL, 
0x0000000000000000UL, 
}

Definition at line 25 of file qp_util.c.