circuitpython/lib/libm/fabsf.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
463 B
C
Raw Permalink Normal View History

/*****************************************************************************/
/*****************************************************************************/
// fabsf from musl-0.9.15
/*****************************************************************************/
/*****************************************************************************/
#include "libm.h"
float fabsf(float x)
{
union {float f; uint32_t i;} u = {x};
u.i &= 0x7fffffff;
return u.f;
}