I am trying to find a more "natural" way to use the number e in C / C ++. I am focused on calculating the function e ^ n.
I think that "cmath", by default, does not provide support for both (function and constant). However, you can include constants defined by the compiler, in this case M_E . You can do this by including the #define _USE_MATH_DEFINES .
On the other hand, e can be defined as a constant:
#define E 2.71828182845904523536;
or
const double EULER = 2.71828182845904523536;
Said it. Which one is the โstandardโ way to approach this mathematical constant? Is this some other library?
c ++ eulers-number
Tony
source share