Back to index

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

Go to the source code of this file.

Functions

double ___q_simulate_exceptions (int exceptions)

Variables

unsigned long long ___q_numbers []

Function Documentation

double ___q_simulate_exceptions ( int  exceptions)

Definition at line 32 of file q_util.c.

{
  double d, *p = (double *)___q_numbers;
  if (exceptions & FP_EX_INVALID)
    d = p[0]/p[0];
  if (exceptions & FP_EX_OVERFLOW)
    {
      d = p[3] + p[3];
      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[0];
  if (exceptions & FP_EX_INEXACT)
    d = p[3] - p[2];
  return d;
}

Variable Documentation

unsigned long long ___q_numbers[]
Initial value:
 {
0x0000000000000000ULL, 
0x0010100000000000ULL, 
0x0010000000000000ULL, 
0x7fef000000000000ULL, 
}

Definition at line 25 of file q_util.c.