Identifying NaN data

I'm fairly new to IGOR and have a basic question. How do I get the program to recognize when data to be input into a formula is NaN?

For example I would like to use data from a wave unless it is NaN, in which case I'd like to input a constant number instead. The following syntax doesn't compile..

if (Wave1[f] == "NaN")
Variable1 = 13
else
Variable1= Wave1[f]

Thx
Use

if (numtype(Wave2[f]) == 2)
    Variable1 = 13
else
    Variable1 = Wave1[f]
endif

IEEE defines comparison with NaN to always return false, no matter what. So you have to use numtype() to find out if it's NaN.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com