comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Exponential of very small numbers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Exponential of very small numbers [message #84279] Wed, 08 May 2013 10:40
Jacopo D is currently offline  Jacopo D
Messages: 2
Registered: May 2013
Junior Member
Thank you Wayne, it works!!
Re: Exponential of very small numbers [message #84280 is a reply to message #84279] Wed, 08 May 2013 09:42 Go to previous message
wlandsman is currently offline  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!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Exponential of very small numbers
Next Topic: IDL Workbench & jumping back to STOP/breakpoints

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:33:48 PDT 2025

Total time taken to generate the page: 0.00370 seconds