Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
s_frexp.c File Reference
#include "fdlibm.h"

Go to the source code of this file.

Functions

double fd_frexp (double x, int *eptr)

Variables

static double two54 = 1.80143985094819840000e+16

Function Documentation

double fd_frexp ( double  x,
int eptr 
)

Definition at line 74 of file s_frexp.c.

{
       int  hx, ix, lx;
        fd_twoints u;
        u.d = x;
       hx = __HI(u);
       ix = 0x7fffffff&hx;
       lx = __LO(u);
       *eptr = 0;
       if(ix>=0x7ff00000||((ix|lx)==0)) return x;       /* 0,inf,nan */
       if (ix<0x00100000) {        /* subnormal */
           x *= two54;
            u.d = x;
           hx = __HI(u);
           ix = hx&0x7fffffff;
           *eptr = -54;
       }
       *eptr += (ix>>20)-1022;
       hx = (hx&0x800fffff)|0x3fe00000;
        u.d = x;
       __HI(u) = hx;
        x = u.d;
       return x;
}

Variable Documentation

double two54 = 1.80143985094819840000e+16 [static]

Definition at line 69 of file s_frexp.c.