The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Processing Not A Number (NaN)

SercoSteveB
Active Participant

What are the contents of Boolean Array Out following execution of the VI?

Not A Number Processing 30_05_2014.png

a) {TRUE, TRUE, TRUE}

b) {FALSE, TRUE, TRUE}

c) {TRUE, FALSE, TRUE}

d) {TRUE, TRUE, FALSE}

Comments
MrStevenUND
Member

I'm going with B. 

Unfortunately, I'm becoming rusty.  I haven't had Labview in about a year now after changing jobs...

crossrulz
Knight of NI

B

From Wikipedia:

"A comparison with a NaN always returns an unordered result even when comparing with itself."

In other words, an equals comparison with NaN will always result in a False.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
SercoSteveB
Active Participant

Answer: B.  Nice one MrStevenUND & crossrulz.

I think crossrulz covered this one.

ashwinilele
Member

B

SUYAM
Member

Can Any one help me out to find why NaN=NaN giving FALSE

crossrulz
Knight of NI

Read my comment above.  An equals comparison to NaN, even with another NaN, will always return a FALSE.  This is the IEEE standard.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
AuZn
Member

Number to fractional string converts NaN to "NaN", and so does the Number to exponential string and Number to engineering string (not a suprise since these two also works on floats).

Number to decimal string also convert NaN to "NaN", though a coersion dot appearred at the input.

Number to hex string and number to oct string convert NaN to "7FFFFFFFFFFFFFFF" and "777777777777777777777" respectively. Not sure why oct string only have 21 7s though.