LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search array

Solved!
Go to solution

Hello all,

 

I have a problem regarding to search array.

It seems like he is unable to find certain elements in the 1D array I deliver. 

Because it outputs -1.

 

I attached my vi + the file

 

Koen

 

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Download All
0 Kudos
Message 1 of 3
(2,335 Views)
Solution
Accepted by topic author KoenR94

You can't accurately do an equals comparison with floating point numbers.  It is just a limitation of floating points in gereral (all computer languages have this issue).  What you should do instead is check to see if a value is in a certain range to account for this limitation.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,332 Views)

I see, now it works.

 

Just multiplied everything by 100 and made it i32.

 

Thanks

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 3 of 3
(2,329 Views)