1*f504f610SAugustin Cavalier #include "libm.h" 2*f504f610SAugustin Cavalier copysign(double x,double y)3*f504f610SAugustin Cavalierdouble copysign(double x, double y) { 4*f504f610SAugustin Cavalier union {double f; uint64_t i;} ux={x}, uy={y}; 5*f504f610SAugustin Cavalier ux.i &= -1ULL/2; 6*f504f610SAugustin Cavalier ux.i |= uy.i & 1ULL<<63; 7*f504f610SAugustin Cavalier return ux.f; 8*f504f610SAugustin Cavalier } 9