Re: Turning off math error checking for a code block [message #28966 is a reply to message #28876] |
Fri, 18 January 2002 09:22  |
Martin Downing
Messages: 136 Registered: September 1998
|
Senior Member |
|
|
craig wrote:
> I have found that an operation on an array which contains NANs is
> slowed down considerably. I think it is because each operation causes
> a floating point exception which is handled in the OS. I use WHERE
> most of the time when this comes up. Occassionally I get "floating
> exception" messages, but big whoop.
To illustrate craigs point:
IDL> a = replicate(!values.f_nan,1024,1024)
IDL> b = replicate(2.0,1024,1024)
IDL> help, a,b
A FLOAT = Array[1024, 1024]
B FLOAT = Array[1024, 1024]
IDL> t = systime(1) & for i =0,9 do c = total(a * 2) & print, systime(1) - t
3.1250000
IDL> t = systime(1) & for i =0,9 do c = total(a * 2) & print, systime(1) - t
3.1240001
IDL> a = replicate(2.0,1024,1024)
IDL> help, a
A FLOAT = Array[1024, 1024]
IDL> t = systime(1) & for i =0,9 do c = total(a * 2) & print, systime(1) - t
0.71099997
|
|
|