projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix potentially wrong-sign zero in cproj functions at infinity
[musl]
/
src
/
math
/
fabsf.c
diff --git
a/src/math/fabsf.c
b/src/math/fabsf.c
index
516f110
..
4efc8d6
100644
(file)
--- a/
src/math/fabsf.c
+++ b/
src/math/fabsf.c
@@
-1,10
+1,9
@@
-#include "libm.h"
+#include <math.h>
+#include <stdint.h>
float fabsf(float x)
{
- union fshape u;
-
- u.value = x;
- u.bits &= (uint32_t)-1 / 2;
- return u.value;
+ union {float f; uint32_t i;} u = {x};
+ u.i &= 0x7fffffff;
+ return u.f;
}