|
Re: Exponential of very small numbers [message #84280 is a reply to message #84279] |
Wed, 08 May 2013 09:42  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
For x very close to zero I would use the approximation
exp(x) = x
or you could display all the digits (and use double precision)
IDL> print,EXP(1.6671699d-013)-1
1.6675550e-13
IDL> print,EXP(1.6671699d-013),f='(f24.18)'
1.000000000000166755
--Wayne
On Wednesday, May 8, 2013 12:14:19 PM UTC-4, Jacopo D wrote:
> Hello, first post ;)
>
> i need to integrate the planck distribution on IDL, but i have a problem with the exponential.
>
> The error is:
>
> EXP(1.6671699e-013)=1
>
>
>
> What can i do to avoid this problem? Even if it's an exponent very close to zero, it's important for my code.
>
> Thanks!
|
|
|