We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5750d4f + 24c11de commit 06f0c63Copy full SHA for 06f0c63
core/math/math_funcs.h
@@ -628,24 +628,11 @@ class Math {
628
}
629
630
static _ALWAYS_INLINE_ float absf(float g) {
631
- union {
632
- float f;
633
- uint32_t i;
634
- } u;
635
-
636
- u.f = g;
637
- u.i &= 2147483647u;
638
- return u.f;
+ return ::fabsf(g);
639
640
641
static _ALWAYS_INLINE_ double absd(double g) {
642
643
- double d;
644
- uint64_t i;
645
646
- u.d = g;
647
- u.i &= (uint64_t)9223372036854775807ll;
648
- return u.d;
+ return ::fabs(g);
649
650
651
// This function should be as fast as possible and rounding mode should not matter.
0 commit comments