LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Has this been reported as a bug? (or am I doing something wrong)

Hi all,

 

I was going through my code after I found it not to work properly.

I have narrowed it down to this example, is there a way around this?

 

I'm doing a comparison of test limits and the result is questionable..

 

Thanks

Erik

 

0 Kudos
Message 1 of 4
(2,272 Views)

Hi Erik,

 

oh those wonders of floating point numeric on computers…

 

You will find a lot of threads here in the forum on FP precision (topics like "never compare floats on equality" or "why is adding 0.1 ten times different than 1"). Read them, understand them.

Or go to Wikipedia

Best regards,
GerdW


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

Just so you know, this is a problem for ALL programming languages, not just LabVIEW.  It is just inherent in attempting to use a finite number of bits to represent an infinitely accurate value.


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
0 Kudos
Message 3 of 4
(2,245 Views)