From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Comparision Evaluation?

Solved!
Go to solution

Hello,

 

I had a bug in my VI and narrowed it down to the following snippet of code. The values in the output array should be 10 for all of the values in the input array. However, for only 1E-11 through 1E-14, LabVIEW appears to evaluate less than 1 instruction incorrectly, which results in an output of 100. In highlight execution, a T is given for is 1 less than 1, which of course is false. If I replace the instruction with a greater than or equal to 1 and change to loop command to Stop instead of loop, I get the same result for the range of 1E-11 through 1E-14. What am I missing? Is this simply a bug in LabVIEW?

 

Thanks,

 

Steve

0 Kudos
Message 1 of 2
(1,966 Views)
Solution
Accepted by topic author Steve_R.

You are running agains the inherent limitation of comparing floating point numbers. There is nothing wrong.

 

(see also)

0 Kudos
Message 2 of 2
(1,960 Views)