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

Home » Public Forums » archive » CHECK_MATH and exp()
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: CHECK_MATH and exp() [message #31965 is a reply to message #31890] Wed, 28 August 2002 07:22 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Surendar Jeyadev wrote:
>
> Could someone please explain this:
...
> WAVE> y = exp(-9.4^2)
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating illegal operand

I only get the first message, not the second.

> ... Also, why does CHECK_MATH() not catch the
> underflow.

Because, as the documentation says:

"No errors detected since the last interactive prompt or call to
CHECK_MATH".

Since the exp() call occurred before the last interactive prompt, it
doesn't count. Instead, try the following:

IDL> y = exp(-9.4^2) & print,check_math(-1)
% Program caused arithmetic error: Floating underflow
32

check_math() wasn't really intended for use at the command line; you get
immediate notification of errors when working interactively, so it isn't
needed.

> And, now for more:
>
> WAVE> .run
> - for i=90,100 do begin
> - x = i/10.0
> - y = exp(-x^2)
> - print, x, y, check_math(1,0)
> - endfor
> - end
> % Compiled module: $MAIN$.
> 9.00000 6.63968e-36 128
> 9.10000 1.08661e-36 128
> 9.20000 1.74307e-37 128
> 9.30000 2.74074e-38 128
> % Program caused arithmetic error: Floating underflow
> % Program caused arithmetic error: Floating illegal operand
> 9.40000 4.22418e-39 160
...

I get:

% Compiled module: $MAIN$.
9.00000 6.63968e-36 0
9.10000 1.08661e-36 0
9.20000 1.74307e-37 0
9.30000 2.74074e-38 0
% Program caused arithmetic error: Floating underflow
9.40000 0.00000 32


> I am running PV-WAVE CL Version 6.01 (sun4 solaris sparc)
> on a Sun Ultra 10 under Solaris 8.

I am running idl 5.4 on an SGI machine running IRIX,
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: overlay a 3D polygon on a 2D grayscale image?
Next Topic: Re: SVDFIT Problems

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

Current Time: Tue Dec 02 11:56:53 PST 2025

Total time taken to generate the page: 0.64174 seconds