musl-tcc/src/math/copysignf.c
2022-03-20 16:48:53 +08:00

11 lines
186 B
C

#include <math.h>
#include <stdint.h>
float copysignf(float x, float y)
{
union {float f; uint32_t i;} ux={x}, uy={y};
ux.i &= 0x7fffffff;
ux.i |= uy.i & 0x80000000;
return ux.f;
}