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

Home » Public Forums » archive » Re: the NaN effect :-|
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: the NaN effect :-| [message #54471 is a reply to message #54396] Wed, 13 June 2007 13:51 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> I have never tested to see if/how much slower they are if you just
> always use the /nan keyword. Might me interesting...

OK, so I had to know what the difference was and it certainly
exists...
running this code I see a difference, of course attach the normal
disclaimers that I just tried once and I was still using my laptop
while this was running and all that jazz

a=findgen(10000)
print, systime()
for i=0l, 1e6 do b=max(a)
print, systime()

print, systime()
for i=0l, 1e6 do b=max(a, /nan)
print, systime()
end

and the output:
Wed Jun 13 16:39:06 2007
Wed Jun 13 16:40:18 2007
Wed Jun 13 16:40:18 2007
Wed Jun 13 16:44:02 2007

So the NaN adds a lot of time, but better safe than "invalid"
certainly.

Brian




------------------------------------------------------------ ---------------------
Brian Larsen
Boston University
Center for Space Physics
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: defining a data structure
Next Topic: Dealing with Large data arrays, reducing memory and ASSOC

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

Current Time: Thu Oct 09 21:21:57 PDT 2025

Total time taken to generate the page: 2.24559 seconds