01-15-2016
09:47 AM
- last edited on
08-19-2024
02:49 PM
by
Content Cleaner
When you just grab the "Equal?" function off the palette and drop it in a BD, the default terminals are of type DBL. I know that the function is polymorphic and will adapt to whatever you wire in, but it seems weird to me that the default form of this VI is a form that is actually strongly discouraged in practice. The Equals? help page even shows DBLs being wired into the function, while this white paper discourages that practice.
This default behavior seems like it could be misleading to those who don't know that it could fail, and seems to encourage wiring DBLs into "Equals." Is there a reason for this being the default?
01-15-2016 10:15 AM
Verywiseguy wrote: Is there a reason for this being the default?
Because the default for everything else is a DBL would be the only rationale I can think of.
01-15-2016 03:23 PM
The Equal function works just fine for Dbl. The problem is that "measuring" (floats) is not as precise as "counting" (integers). If I were to wire any legal float to both inputs of an Equals? function, I would get "True". On the other hand, if I tried to compare the sine of 30° with 0.5, I would probably get "False", because (a) the representation of 30° in radians has limited precision, (b) the computation of sine(x) has limited precision, and (c) the representation of 0.5 (because it is an integral power of 2, namely 2^-1) is probably precise. An imprecise function of an imprecise argument should not be expected to give a precise result. Hence the warning.
Bob Schor
01-15-2016
03:42 PM
- last edited on
08-19-2024
02:49 PM
by
Content Cleaner
@Verywiseguy wrote:
This default behavior seems like it could be misleading to those who don't know that it could fail, and seems to encourage wiring DBLs into "Equals." Is there a reason for this being the default?
You Could write a custom VIA Test for that and share it with the community- OverHere