LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Less than operator misbehave

Solved!
Go to solution

The values came from (string to number) pattern match and were misbehaving.

After tinkering with type casting and formats (didn't spend much time though), there was no change in wrong evaluation:

 

 

 

 wrong evaluation.jpg

Message Edited by labview-programmer on 06-04-2010 10:19 PM
Message Edited by labview-programmer on 06-04-2010 10:21 PM
Best,
Aniket
0 Kudos
Message 1 of 9
(3,562 Views)
Solution
Accepted by topic author labview-programmer

Sneaky. X is 4.4999999999999998

 

Richard






0 Kudos
Message 2 of 9
(3,548 Views)

We have our weekly (at least) winner in the mysteries of floating point values contest.

 

See this thread to start.

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=41383&query.id=2902191#M41383

0 Kudos
Message 3 of 9
(3,546 Views)
And another nickel to my retirement fund!
0 Kudos
Message 4 of 9
(3,538 Views)

smercurio_fc wrote:
And another nickel to my retirement fund!

 

Better re-check your statement. They are only depositing 4.99999999982 cents.
Richard






0 Kudos
Message 5 of 9
(3,527 Views)

No it works. And this is common problem then working with floating point numbers :smileyvery-happy: The problem are caused by small rounding errors. The number format is the source of the trouble. It has been a lot of postings about this

Use the in range check instead.

sample1.PNG



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 9
(3,515 Views)

Yes, correct.

 

but least expected this. as it was initialised as fig.1 and incremented as fig.2

 

fp.jpg 

Best,
Aniket
0 Kudos
Message 7 of 9
(3,512 Views)
smercurio_fc wrote:

Better re-check your statement. They are only depositing 4.99999999982 cents.

 

 

Hey, don't be stealing my salami! (wikipedia: Salami slicing)
0 Kudos
Message 8 of 9
(3,511 Views)

labview-programmer wrote:

Yes, correct.

 

but least expected this. as it was initialised as fig.1 and incremented as fig.2

 

fp.jpg 


 

Aniket, change 'em to DBL's.
Richard






0 Kudos
Message 9 of 9
(3,461 Views)