cosmopolitan/libc/math/fabsf.c

9 lines
126 B
C

#include "libc/math/math.h"
float fabsf(float x)
{
union {float f; uint32_t i;} u = {x};
u.i &= 0x7fffffff;
return u.f;
}