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

Home » Public Forums » archive » Re: Integer rounding of NaN
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: Integer rounding of NaN [message #58109] Tue, 15 January 2008 06:33
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
I agree. I simply forgot to read the accompagnying error message:
Finite function is TRUE, but one has to catch the arithmetic error !

IDL> print,finite(round(!values.f_nan))
1
Program caused arithmetic error: Floating illegal operand
Re: Integer rounding of NaN [message #58110 is a reply to message #58109] Tue, 15 January 2008 05:56 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> IDL> print, float (round (!Values.F_NAN))
> -2.14748e+009

You should not expect this to work... as !Values.F_NAN is literally
not a number and the build in idl routines are notorious for not
doing any checking of their own for NaN and Inf. One is normally best
off making sure all the numbers are good before doing round,
r_correlate, sort, and many others.




Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Integer rounding of NaN
Next Topic: Question for ITTVIS: Will there ever be an IDL Workbench plugin for Eclipse?

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

Current Time: Wed Oct 08 20:05:45 PDT 2025

Total time taken to generate the page: 0.01289 seconds