LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

any one please explain?

Any one please can explain what is the different in this vi?
Thanks
0 Kudos
Message 1 of 4
(2,782 Views)
The difference between 4.7 and 4.6 + 0.1 exists because of the way in which floating point numbers are computed in digital systems.  See the article here.

The result is that 4.7 is really 4.7000000000000002 and 4.6 + 0.1 is 4.6999999999999993.

Dan Press
Certified LabVIEW Architect
PrimeTest Automation
0 Kudos
Message 2 of 4
(2,778 Views)
Rounding error. Floating point numbers are only approximations of real numbers hence you sometimes don't get what you would expect when doing comparisons. To see what I mean, take the result of your addition and 4.7 and flatten both to a string so you can see the binary representation of the numbers in memory. (be sure to set the text display in the indicators to "Hex Display").

The result of the addition is: 4012 CCCC CCCC CCCC
Whereas 4.7 is:                    4012 CCCC CCCC CCCD

It's a very small difference, but (4.6 + 0.1) is smaller than 4.7...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 4
(2,775 Views)
Young Daniel!

How goes things? What are you up to these days? Contact me back-channel if you have a chance...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(2,769 Views)