01-06-2006 06:55 AM
01-06-2006 07:03 AM
Hola DaviZ,
Indeed..
That is funny, no ?
You've pointed an interesting problem, there is absolutely no bug and neither something wrong with LabVIEW.
Just keep in mind that in a computer, a number is just an array of byte (and one byte is 8 bits [0;1]).
So when it comes to floating numbers, the number you see is always an approximation with a given accuracy depending on the numeric representation (SGL in your case).
here is
an exemple "almost equal.vi" just to play and explain the fact, have
a look at it
To fix this in your code, I know 2 different ways :
1. instead of "strictly equal to" use an "almost equal to" function in which you can set the accuracy you want.
2. or if you like playing with bytes, just put to 0, "small weight byte" (See attached "NUM_SGL....vi")
it only works with SGL numbers, but you can't get inspiration to develop the same kind of vi for DBL or whatever representation.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus