See here for the proper LabVIEW bug reporting procedure.
Tags |
(This content has not been tagged yet)
|
![]() |
Oct 24 2007, 09:21 AM
Post
#1
|
|||
![]() Active Member Posts: 11 Joined: 12-January 07 From: Randers Member No.: 7489 Using LabVIEW Since:1997 LV:6.1 ,8.20 ,.
|
Hi
I got a problem with the compare function "Greater?". I use it the way you can see in the VI. With the controls set as default there is no problem. The current value cycles between 8 and 4 with 0.2 steps. The problem is that when I set the Start value less than 7.6, current value never reach 8.00. I can't what's wrong with my VI, or is it the Greater? funktion that got a bug ? best regards Bjarne Jørgensen PS: It's the same behaviour in LV6.1 and 8.2 The Vi is in 8.2
Attached File(s)
|
||
|
|
|||
| Ad |
Oct 24 2007, 09:21 AM
Post
#
|
||
|
|
|
||
|
|
|||
Oct 24 2007, 09:47 AM
Post
#2
|
|||
![]() Extremely Active Member Posts: 262 Joined: 26-January 05 Member No.: 1450 Using LabVIEW Since:2000 LV:8.5 ,8.20 ,7.1.1
|
Well, the problem arises in the "7.8" step, when you compare two "7.8" values and the "greater?" function returns true. I'm not an expert on this but I believe is usual for floating point numbers not to be exactly the expected value, due to accuracy limits (number of bytes, etc). Surely someone else can explain better.
Anyway, it's better to avoid those risks. For example, you can substract both values and check if the difference is greater than 0.1, or work with integers and convert then to double in the end. Saludos, Aitor This post has been edited by Aitor Solar: Oct 24 2007, 09:47 AM
|
||
|
|
|||
Oct 24 2007, 11:51 AM
Post
#3
|
|||
![]() Active Member Posts: 11 Joined: 12-January 07 From: Randers Member No.: 7489 Using LabVIEW Since:1997 LV:6.1 ,8.20 ,.
|
Well, the problem arises in the "7.8" step, when you compare two "7.8" values and the "greater?" function returns true. I'm not an expert on this but I believe is usual for floating point numbers not to be exactly the expected value, due to accuracy limits (number of bytes, etc). Surely someone else can explain better. Anyway, it's better to avoid those risks. For example, you can substract both values and check if the difference is greater than 0.1, or work with integers and convert then to double in the end. Saludos, Aitor I have tryed with integers and then there is no problem. If I set the procision to 20 digits for a DBL-control I see a strange behaviour. If I type 0.5 then i display 0.50000000000000000000, but if I type 0.2 then it display 0.20000000000000001100 Why is that ? Bjarne Update: I found this on Lava http://wiki.lavag.org/Numeric This explain the problem This post has been edited by Bjarne Joergensen: Oct 24 2007, 12:19 PM
|
||
|
|
|||
![]() ![]() |
| Time is now: 8th January 2009 - 10:59 PM |