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

Home » Public Forums » archive » Re: Wow. exp() difficulties...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Wow. exp() difficulties... [message #9606 is a reply to message #9601] Thu, 24 July 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
lady of the elves writes:

> I've encountered a really interesting--though annoying--problem. I'm
> trying to use exp(a), where a>88 or so. My calculator can do it...the
> program can't. It gives me a "floating underflow" error.
>
> Can anyone give me more information on how to work this out? I haven't
> yet figured out long numbers...nor how they differ from floating point.
> I don't know if these uncertainties relate, but all of my numbers are
> floating point.
>
> Is it just that the language can't handle the numbers? e^89=4.4*10^38;
> it's rather large--but is it just that it can't handle the size? Or the
> precision? Is it that I need to know more about long numbers?

I am no expert in this area, but I think the problem here is with
precision. e^89 is just simply too large to be represented adequately
as a floating point number (4 bytes). You need more bits. The problem
can be eliminated by casting your floating values to doubles. For
example,
this works:

a = 89.0
Print, EXP(Double(a))
4.4896128e+038

> What *is* a floating underflow?

In this case, it is a number that is so large it begins
to appear small. It's, er, a mystical thing. :-)

Cheers,

David

------------------------------------------------------------ -
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
IDL 5 Reports: http://www.dfanning.com/documents/anomaly5.html
[Message index]
 
Read Message
Read Message
Previous Topic: Q: Debugging: Unable to create pixmaps
Next Topic: Converting data

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

Current Time: Sun Oct 12 14:44:32 PDT 2025

Total time taken to generate the page: 1.27596 seconds