float[] difference
<p>I'm wonder what's the most efficient way to find the the absolute value of the difference between two float arrays?</p>

<p>Is it the following:</p>

<pre><code>private float absDifference(float[] vector1, float[] vector2) {
    float difference=0;
    int len=Math.max(vector1.length, vector2.length);
    for(int n=0;n&lt;len;n++){
        float diff=0;
        if(n&lt;vector1.length){
            diff+=vector1[n];
        }
        if(n&lt;vector2.length){
            diff-=vector2[n];
        }
        difference+=Math.abs(diff);
    }
    return difference;
}
</code></pre>
