ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nan => UInt bug?

When I have a DBL with value NaN and I convert it into a U64 and flatten it to a string, I get x0000 0000 for a value.
When I covert it to a I64 first, I get x7FFF FFFF.
 
I believe that the U64 case is a bug (it's also true for U32s). It certainly is inconvenient for my application.
 
Any comment?
0 Kudos
Message 1 of 2
(2,644 Views)
Hi 10things,

my comment is copied from the LabView help on NaN:
*******
Floating-point operations propagate NaN and Inf faithfully. When you explicitly or implicitly convert NaN or Inf to integers or Boolean values, the values become meaningless. For example, dividing 1 by zero produces Inf. Converting Inf to a 16-bit integer produces the value 32,767, which appears to be a normal value.

Before you convert data to integer data types, use the Probe tool to check intermediate floating-point values for validity. Check for NaN by wiring the Comparison function Not A Number/Path/Refnum? to the value you suspect is invalid.

*******

The important parts are set to bold Smiley Wink

Another note: How do you want to convert NaN? What should be the result? For integers something like NaN doesn't exist...





Message Edited by GerdW on 12-03-2007 09:40 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,624 Views)