LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programmatically enter the value inf or NaN into a variable

My program saves and reads float data arrays to/from files in text format.

However, when a value is +inf, -inf or NaN, this ends up in the text file. So far no problem. The problem starts when I try to READ the text file. I want to restore the array to its previous state, including inf and NaN values.

When encountered during read, how do I assign these values to a variable programmatically?

Or, what are the #define values of NaN etc, if any?

Erwin Timmerman
0 Kudos
Message 1 of 4
(3,442 Views)
Hi Erwin,

Please have a look at this discussion: Not a Number, as it details also about the same problems.


I hope this answers your question.

ErikvH
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,442 Views)
Also, if you're using CVI 7.0, you can use the PositiveInfinity, NegativeInfinity, and NotANumber functions from the Programmer's Toolbox Library.

Luis
NI
0 Kudos
Message 3 of 4
(3,442 Views)
Which section of the Progs Toolbox are these functions in? I couldn't find them.

Paul
0 Kudos
Message 4 of 4
(3,442 Views)