From f6700ae5c00a902e3eed276bd4581867d063c5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 27 Jan 2018 21:43:19 -0800 Subject: [PATCH] Cleanup. --- include/bx/math.h | 3 +++ src/math.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/bx/math.h b/include/bx/math.h index b4707d5..50f64db 100644 --- a/include/bx/math.h +++ b/include/bx/math.h @@ -146,6 +146,9 @@ namespace bx /// float ldexp(float _a, int32_t _b); + /// + float frexp(float _a, int32_t* _outExp); + /// Returns e (2.71828...) raised to the _a power. float exp(float _a); diff --git a/src/math.cpp b/src/math.cpp index c804553..b792651 100644 --- a/src/math.cpp +++ b/src/math.cpp @@ -153,7 +153,7 @@ namespace bx return result; } - float frexp(float _a, int32_t* _exp) + float frexp(float _a, int32_t* _outExp) { const uint32_t ftob = floatToBits(_a); const uint32_t masked0 = uint32_and(ftob, UINT32_C(0x7f800000) ); @@ -162,7 +162,7 @@ namespace bx const uint32_t bits = uint32_or(masked1, UINT32_C(0x3f000000) ); const float result = bitsToFloat(bits); - *_exp = int32_t(exp0 - 0x7e); + *_outExp = int32_t(exp0 - 0x7e); return result; }