Commit 56da07dc authored by Damien George's avatar Damien George
Browse files

stmhal, math: Define _M_LN2 if not already defined.

Addresses issue #790.
parent dd07023c
......@@ -102,6 +102,10 @@ float copysignf(float x, float y) {
#ifdef log2f
#undef log2f
#endif
// some compilers have _M_LN2 defined in math.h, some don't
#ifndef _M_LN2
#define _M_LN2 (0.69314718055994530942)
#endif
float log2f(float x) { return logf(x) / (float)_M_LN2; }
static const float _M_LN10 = 2.30258509299404; // 0x40135d8e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment