I'm in C++ and I'm using the exponential function exp()
from <cmath>
. I'm dealing with very small number, so I tried to use also expl()
fucntion, but the (incorrect) result is always the same: 1.
I show you a very quick example. How can I solve this problem? Thanks.
#include <cmath>
...
long double a= 1.40543081e-8;
cout << "exp(-a)= " << exp(-a) << endl;
cout << "expl(-a)= " << expl(-a) << endl;
The output is:
exp(-a)= 1
expl(-a)= 1
Thanks for help.