mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Cleanup.
This commit is contained in:
@@ -402,6 +402,16 @@ namespace bx
|
||||
|
||||
inline BX_CONSTEXPR_FUNC float log(float _a)
|
||||
{
|
||||
if (_a < 0.0f)
|
||||
{
|
||||
return bitsToFloat(kFloatSignMask | kFloatExponentMask | kFloatMantissaMask);
|
||||
}
|
||||
|
||||
if (_a == 0.0f)
|
||||
{
|
||||
return -kFloatInfinity;
|
||||
}
|
||||
|
||||
const uint32_t ftob = floatToBits(_a);
|
||||
|
||||
const uint32_t masked0 = uint32_and(ftob, kFloatExponentMask);
|
||||
@@ -465,6 +475,11 @@ namespace bx
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
if (isInfinite(_a) && _a < 0.0f)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
constexpr float kExpC0 = 1.66666666666666019037e-01f;
|
||||
constexpr float kExpC1 = -2.77777777770155933842e-03f;
|
||||
constexpr float kExpC2 = 6.61375632143793436117e-05f;
|
||||
|
||||
Reference in New Issue
Block a user