Back to index

glibc  2.9
Functions | Variables
s_scalblnl.c File Reference
#include "math.h"
#include "math_private.h"

Go to the source code of this file.

Functions

long double __scalblnl (long double x, long int n)

Variables

static long double two63 = 4.50359962737049600000e+15
static long double twom63 = 1.08420217248550443400e-19
static long double huge = 1.0e+4900L
static long double tiny = 1.0e-4900L

Function Documentation

long double __scalblnl ( long double  x,
long int  n 
)

Definition at line 44 of file s_scalblnl.c.

{
       int32_t k,es,hx,lx;
       GET_LDOUBLE_WORDS(es,hx,lx,x);
        k = es&0x7fff;                           /* extract exponent */
        if (k==0) {                       /* 0 or subnormal x */
            if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
           x *= two63;
           GET_LDOUBLE_EXP(es,x);
           k = (hx&0x7fff) - 63;
           }
        if (k==0x7fff) return x+x;        /* NaN or Inf */
        k = k+n;
        if (n> 50000 || k > 0x7ffe)
         return huge*__copysignl(huge,x); /* overflow  */
       if (n< -50000)
         return tiny*__copysignl(tiny,x);
        if (k > 0)                        /* normal result */
           {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
        if (k <= -63)
           return tiny*__copysignl(tiny,x);      /*underflow*/
        k += 63;                          /* subnormal result */
       SET_LDOUBLE_EXP(x,(es&0x8000)|k);
        return x*twom63;
}

Here is the call graph for this function:


Variable Documentation

long double huge = 1.0e+4900L [static]

Definition at line 38 of file s_scalblnl.c.

long double tiny = 1.0e-4900L [static]

Definition at line 39 of file s_scalblnl.c.

long double two63 = 4.50359962737049600000e+15 [static]

Definition at line 36 of file s_scalblnl.c.

long double twom63 = 1.08420217248550443400e-19 [static]

Definition at line 37 of file s_scalblnl.c.