From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NaN

Hello,

How is it possible to manage NaN,+Inf, -Inf value in a numeric control with CVI ?.
How can I get the sign bit, the exponent and the mantissa ? I've to translate a four bytes value conform with the IEEE standard ( and so with CVI compiler )into float value but a call to memcpy() seems not to work. My documentation is too poor.
I think I have to do a few traitement before using ldexp() or the formula (-1)^S*2^(exponent-127)*(1.F) with (F :mantissa ).
Can I have a sample of translation between a float and its 4 butes memory ?
0 Kudos
Message 1 of 2
(2,751 Views)
See Bilal's comments here.
0 Kudos
Message 2 of 2
(2,751 Views)