summaryrefslogtreecommitdiff
path: root/src/math/fabsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/fabsf.c')
-rw-r--r--src/math/fabsf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/math/fabsf.c b/src/math/fabsf.c
new file mode 100644
index 00000000..516f1104
--- /dev/null
+++ b/src/math/fabsf.c
@@ -0,0 +1,10 @@
+#include "libm.h"
+
+float fabsf(float x)
+{
+ union fshape u;
+
+ u.value = x;
+ u.bits &= (uint32_t)-1 / 2;
+ return u.value;
+}