Fix bx::flog2 giving incorrect result when compiled to asm.js. (#150)

This commit is contained in:
Jonathan Young
2017-05-15 02:28:37 +10:00
committed by Branimir Karadžić
parent e02f49a918
commit 0645f91289
2 changed files with 5 additions and 5 deletions

View File

@@ -136,11 +136,6 @@ namespace bx
return fpow(2.0f, _a);
}
inline float flog2(float _a)
{
return flog(_a) * 1.442695041f;
}
inline float frsqrt(float _a)
{
return 1.0f/fsqrt(_a);

View File

@@ -63,6 +63,11 @@ namespace bx
return ::logf(_a);
}
float flog2(float _a)
{
return ::logf(_a) * (1 / ::logf(2));
}
float fsqrt(float _a)
{
return ::sqrtf(_a);