09-22-2015 01:13 PM
Hi all,
Im curious if anyone has seen this before or knows why its not working. I have a greater than or equal function and i am comparing two doubles. Ive probed the numbers entering the function so i know that the 2 numbers entering the function are the same.
Problem is i dont get a true from the function until the comparasin value is greater than the number entering.
Using LV2011.
Any reason this happens?
Thank you,
Matt
Solved! Go to Solution.
09-22-2015
01:25 PM
- last edited on
05-29-2025
02:11 PM
by
Content Cleaner
Guess i answered my own question
https://www.ni.com/docs/en-US/bundle/labview/page/using-comparison-functions.html
09-22-2015 03:38 PM
09-22-2015 03:44 PM
I actually dont know. For me i just lowered the number it was compared to ha in the link i posted it just says funny behavior can be expected. I didnt really look any further into it. What exactly would be the solution to this?
Thanks,
matt
09-22-2015 06:57 PM
The problem with floating points is that they are not exact. If they are off by a bit or two, your numbers are not equal. This is because a large majority of numbers cannot be accurately saved in 64 bits.
09-22-2015 09:57 PM
09-23-2015 01:10 AM
Hi Matt,
would it be a good idea to convert them to integers?
That depends on your numbers - you didn't tell us anything about them before…
When Agilent chose DBL datatype they did this for a reason (atleast I guess). So using integers instead might lead to other problems!