py/objfloat, py/modmath: Ensure M_PI and M_E defined.
In some compliation enviroments (e.g. mbed online compiler) with strict standards compliance, <math.h> does not define constants such as M_PI. Provide fallback definitions of M_E and M_PI where needed.
This commit is contained in:
committed by
Damien George
parent
d45e5f8c35
commit
a896951a9a
@@ -31,6 +31,11 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// M_PI is not part of the math.h standard and may not be defined
|
||||
#ifndef M_PI
|
||||
#define M_PI (3.14159265358979323846)
|
||||
#endif
|
||||
|
||||
/// \module math - mathematical functions
|
||||
///
|
||||
/// The `math` module provides some basic mathematical funtions for
|
||||
|
||||
Reference in New Issue
Block a user