How PI is defined in pymath.h using C

1 Answer

0 votes
/* High precision definition of pi and e (Euler)
 * The values are taken from libc6's math.h.
 */
#ifndef Py_MATH_PIl
#define Py_MATH_PIl 3.1415926535897932384626433832795029L
#endif
#ifndef Py_MATH_PI
#define Py_MATH_PI 3.14159265358979323846
#endif

#ifndef Py_MATH_El
#define Py_MATH_El 2.7182818284590452353602874713526625L
#endif

#ifndef Py_MATH_E
#define Py_MATH_E 2.7182818284590452354
#endif

/* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */
#ifndef Py_MATH_TAU
#define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
#endif 

 



answered Mar 15, 2022 by avibootz

Related questions

2 answers 1,143 views
1 answer 96 views
96 views asked Apr 10, 2022 by avibootz
1 answer 55 views
1 answer 92 views
92 views asked May 14, 2023 by avibootz
1 answer 135 views
135 views asked May 7, 2021 by avibootz
...