1
0

copysignf.c 186 B

12345678910
  1. #include <math.h>
  2. #include <stdint.h>
  3. float copysignf(float x, float y)
  4. {
  5. union {float f; uint32_t i;} ux={x}, uy={y};
  6. ux.i &= 0x7fffffff;
  7. ux.i |= uy.i & 0x80000000;
  8. return ux.f;
  9. }