03-22-2013 01:23 AM
johnsold .... you are right, I should have added the epsilon back again (or to select the value from the original array)
but remember, There is a Delta for Every Epsilon 🙂
03-30-2016 08:03 AM
I have created the following sub-VI to find the Max and Non-zero Minimum of an array (assuming positive values) using a basic algorithm because I don't like loops. You can replicate in excell to understand the maths, the only difference is the [Round Down to Nearest Integer] function is the INT() function in excel.
Regards
R Gibbs
03-30-2016 12:15 PM
03-30-2016 01:22 PM
@rg8766 wrote:
One immediately obvious serious flaw is the fact that the "Non-Zero Min" is most likely not binary indentical to the array element at that location. After all, you are doing some serious manipulation on it. A much better solution would be to index out the element from the original array, once you have the "Min index".
I have not verified the correct operation of your code, just looking at the picture for now. I will, after you attach the actual VI.
04-19-2016 10:12 AM
I was just trying to help with the solution I came up with when I wanted the same functionality. This is my first time on the forum. I wont bother in future if Mr 31.5K "Knight of NI" is going to be so abrupt. I have attached the actual .vi file (wasn't aware that a "listing" of the code ie. a picture wasn't sufficient). It works fine for me, and I have no idea what "binary indentical" means. I am only 3 months into LabView and have been impressed by the tutorials NI produce, so I will not let Mr Altenbach tarnish that for me.
04-19-2016 10:50 AM
So you will wait until you have a problem with the code and wonder why it doesn't work the way you expect?
Not all numbers can be represented exactly in a binary number system. Did you know that 1 divided by 3 then multiplied by 3 in math equals 1, but in a computer doesn't? That is what he is talking about. (There are probably better examples than this.)
If you are aware of the pitfalls of certain operations, you can prevent that from affecting how your code performs.
04-19-2016 02:29 PM
@RavensFan wrote:Not all numbers can be represented exactly in a binary number system. Did you know that 1 divided by 3 then multiplied by 3 in math equals 1, but in a computer doesn't? That is what he is talking about. (There are probably better examples than this.)
Here is another example: Floating Zero
It uses a subtraction by 0.1 and stopping a loop when it equals 0. But 0.8 - 0.1 eight times does not equal 0.