mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Fix bx::flog2 giving incorrect result when compiled to asm.js. (#150)
This commit is contained in:
committed by
Branimir Karadžić
parent
e02f49a918
commit
0645f91289
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user