Back to index

glibc  2.9
Defines | Functions
e_scalb.c File Reference
#include <math.h>
#include "math_private.h"
#include "mathimpl.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define SUFF
#define float_type   double
#define CONCATX(a, b)   __CONCAT(a,b)
#define s(name)   CONCATX(name,SUFF)
#define m81(func)   __m81_u(s(func))


float_type s() __ieee754_scalb (float_type x, float_type fn)

Define Documentation

#define CONCATX (   a,
)    __CONCAT(a,b)

Definition at line 31 of file e_scalb.c.

#define float_type   double

Definition at line 28 of file e_scalb.c.

#define m81 (   func)    __m81_u(s(func))

Definition at line 33 of file e_scalb.c.

#define s (   name)    CONCATX(name,SUFF)

Definition at line 32 of file e_scalb.c.

#define SUFF

Definition at line 25 of file e_scalb.c.

Function Documentation

Definition at line 36 of file e_scalb.c.

  float_type retval;
  unsigned long x_cond = __m81_test (x);
  unsigned long fn_cond = __m81_test (fn);

  if ((x_cond | fn_cond) & __M81_COND_NAN)
    return x * fn;

  if (fn_cond & __M81_COND_INF)
      if (!(fn_cond & __M81_COND_NEG))
       return x * fn;
      else if (x_cond & __M81_COND_ZERO)
       return x;
       return x / -fn;

  if (m81(__rint) (fn) != fn)
    return (x - x) / (x - x);

  __asm ("fscale%.x %1, %0" : "=f" (retval) : "f" (fn), "0" (x));
  return retval;

Here is the call graph for this function: