12-19-2008 08:31 AM
Solved! Go to Solution.
12-19-2008 08:37 AM
pi is represented to about 15 decimal places in LabVIEW. The probe is showing only 5. There is more than likely a difference between the two numbers, but you need to see more decimal places to be sure. Try wiring the two values to indicators on your front panel that show more decimal places and inspecting them.
Also, see http://digital.ni.com/public.nsf/allkb/AF5DC9D469B3917186256ACD0051D4E7
12-19-2008 08:51 AM
12-19-2008 09:07 AM
12-19-2008 09:28 AM
Thank you guys.
As I guessed, I have a not exactly number I want. I decided to use a customize compare VI with difference after 6 precision digits.
Have a happy holiday.
Thang Nguyen
12-19-2008 09:29 AM
The ting to discuss is how I get rid of unwanted accuracy or precision because 12.1100000000001 are not equal 12.11 .
12-19-2008 09:38 AM
12-19-2008 10:40 AM
Thoric wrote:
smercurion - does this not amount to the same thing?
Depends on your viewpoint. Essentially, yes, but it's due to the fundamental way that numbers are stored, and nothing to do with Pi, or how many significant digits there are. The same thing would happen with any other floating point number.
Besides, the purists would argue that you can never check if a number is equal to Pi since Pi is a transcendental number.
12-19-2008 10:42 AM
Hi,
I really have trouble with this, cause sin(pi) is not 0. It will affect to many calculation results.
12-19-2008 11:47 AM
Sin (pi) is smaller than machine epsilon, which means that it is effectively zero.
As has been stated above, equality comparisons with non-integer representations of numbers will always be problematic. Several little VIs have been posted which address this issue in a variety of ways, mostly by doing inequality comparisons with a small limit range usingthe machine epsilon or user selected value.
Lynn