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

Home » Public Forums » archive » Odd behavior with NaNs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Odd behavior with NaNs [message #93513] Tue, 09 August 2016 09:28 Go to previous message
whdaffer is currently offline  whdaffer
Messages: 10
Registered: January 2000
Junior Member
At least, I think it's odd.


IDL> print,sqrt(!values.f_nan>0.0)
0.00000
% Program caused arithmetic error: Floating illegal operand
IDL>

-- while --

IDL> print,sqrt(!values.f_nan)
NaN

I was trying to protect against taking the sqrt of a negative number. I guess I could just remove the >0.0 and live with

DL> print,sqrt(-1)
-NaN
% Program caused arithmetic error: Floating illegal operand

whenever there are negative numbers in my data.

What does the community think? Bug? Feature?

whd
[Message index]
 
Read Message
Read Message
Previous Topic: Baffled by out of range subscript error
Next Topic: Running fortran exectuable using IDL spawn fails

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

Current Time: Wed Oct 08 15:47:26 PDT 2025

Total time taken to generate the page: 0.00482 seconds