# Logic operation with NaN cell Hello,

I have some troubles to find if a cell is blank or not.

For example,

I create a wave0, single element, which is blank.

print wave0

The result is NaN.

print wave0==NaN

But the result is 0, which means the statement is wrong.

Hi,

Use Numtype

numtype(num )
The numtype function returns a number which indicates what kind of value num contains.
Details
If num  is a real number, numtype returns a real number whose value is:
0:    num  contains a normal number.
1:    num  contains +/-INF.
2:    num  contains NaN.
If num  is a complex number, numtype returns a complex number in which the real part is the number type of the real part of num  and the imaginary part is the number type of the imaginary part of num  .

Andy

Just a note: this is how NaN works by IEEE 488 standard. All comparisions with NaN return false. This apparently nonsensical behavior leads to a common test for NaN:

Function test()
Variable a = NaN
if (a != a)
print "It's a NaN"
endif
end