fabs.c 135 B

123456789
  1. #include <math.h>
  2. #include <stdint.h>
  3. double fabs(double x)
  4. {
  5. union {double f; uint64_t i;} u = {x};
  6. u.i &= -1ULL/2;
  7. return u.f;
  8. }