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

Home » Public Forums » archive » Re: Locate an underflow
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: Locate an underflow [message #25127] Tue, 22 May 2001 19:58 Go to next message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
Hi Francesco,

I think you want to set the following system variable. I was playing with
this today. Program execution will continue, but the standard error
message (w/ line number included) should be printed out.

!except = 2

-k.


--
Ken Mankoff
LASP://303.492.3264
http://lasp.colorado.edu/~mankoff/

On Tue, 22 May 2001, Francesco wrote:

> Hi,
>
> I've got this error
>
> % Program caused arithmetic error: Floating underflow
>
> Is it possible to know where it appens without putting a million of
> stop or breakpoint in my program?
>
> Thank you
>
> Ciao
>
> Francesco
>
Re: Locate an underflow [message #25131 is a reply to message #25127] Tue, 22 May 2001 15:05 Go to previous messageGo to next message
m.hadfield is currently offline  m.hadfield
Messages: 36
Registered: April 2001
Member
From: "Francesco" <francesco.spada@jrc.it>
> I've got this error
>
> % Program caused arithmetic error: Floating underflow
>
> Is it possible to know where it appens without putting a million of
> stop or breakpoint in my program?

Set the !EXCEPT system variable to 2.

From IDL 5.4 documentation:

!EXCEPT

An integer variable that controls when IDL checks for invalid
mathematical computations (exceptions), such as division by zero.
The three allowed values are:

Value Description

0 Never report exceptions.

1 Report exceptions when the interpreter is returning to an
interactive prompt (the default).

2 Report exceptions at the end of each IDL statement. Note that
this slows IDL by roughly 5% compared to setting !EXCEPT=1.

For more information on invalid mathematical computations and
error reporting, see Math Errors. The value of !EXCEPT is used by
the CHECK_MATH function to determine when to return errors. See
CHECK_MATH for details.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Re: Locate an underflow [message #25221 is a reply to message #25131] Wed, 23 May 2001 08:08 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
m.hadfield@niwa.cri.nz ("Mark Hadfield") writes:

> From: "Francesco" <francesco.spada@jrc.it>
>> I've got this error
>>
>> % Program caused arithmetic error: Floating underflow
>>
>> Is it possible to know where it appens without putting a million of
>> stop or breakpoint in my program?

> Set the !EXCEPT system variable to 2.

> From IDL 5.4 documentation:

> !EXCEPT

> An integer variable that controls when IDL checks for invalid
> mathematical computations (exceptions), such as division by zero.
> The three allowed values are:

> Value Description

> 0 Never report exceptions.

> 1 Report exceptions when the interpreter is returning to an
> interactive prompt (the default).

> 2 Report exceptions at the end of each IDL statement. Note that
> this slows IDL by roughly 5% compared to setting !EXCEPT=1.

> For more information on invalid mathematical computations and
> error reporting, see Math Errors. The value of !EXCEPT is used by
> the CHECK_MATH function to determine when to return errors. See
> CHECK_MATH for details.

> ---
> Mark Hadfield
> m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
> National Institute for Water and Atmospheric Research


What I would really like is something that would differentiate between
underflow errors and all other exceptions. I think that most users don't know
what an underflow "error" is, and their initial reaction is that something bad
is going on. I see that the IDL help now contains the following statement:

A Note on Floating-Point Underflow Errors

Floating-point underflow errors occur when a non-zero result is so
close to zero that it cannot be expressed as a normalized
floating-point number. In the vast majority of cases, floating-point
underflow errors are harmless and can be ignored. For more information
on floating-point numbers, see Accuracy & Floating-Point Operations.

In the old days, IDL didn't even bother to report underflow errors.

Even when you do know that underflow "errors" are (almost always) harmless,
continuously getting these messages is highly annoying. I'd use !EXCEPT=0 to
suppress underflow messages, except that it would also suppress other
potentially more serious error messages as well.

How about something like the following for additional values for !EXCEPT:

Value Description

3 Suppress underflow errors, but report other exceptions when the
interpreter is returning to an interactive prompt.

4 Suppress underflow errors, but report other exceptions at the end of
each IDL statement.

William Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: color woes - redux
Next Topic: keyword question

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

Current Time: Thu Oct 09 22:03:15 PDT 2025

Total time taken to generate the page: 0.72070 seconds