amath  1.8.5
Simple command line calculator
csign.c File Reference
#include "prim.h"
Include dependency graph for csign.c:

Go to the source code of this file.

Functions

double copysign (double x, double y)
 Returns a value with the magnitude of x and with the sign bit of y. More...
 

Function Documentation

◆ copysign()

double copysign ( double  x,
double  y 
)

Returns a value with the magnitude of x and with the sign bit of y.

Definition at line 47 of file csign.c.

Referenced by scalbn().

48 {
49  uint32_t hx, hy;
50  GET_HIGH_WORD(hx, x);
51  GET_HIGH_WORD(hy, y);
52  SET_HIGH_WORD(x, (hx & 0x7fffffff) | (hy & 0x80000000));
53  return x;
54 }
#define GET_HIGH_WORD(i, d)
Get the more significant 32 bit int from a double.
Definition: prim.h:167
#define SET_HIGH_WORD(d, v)
Set the more significant 32 bits of a double from an int.
Definition: prim.h:198
Here is the caller graph for this function: