norm2 doesn't adhere to spec

Issue #346 resolved
Aaron R Robinson created an issue

The Math.norm2 specification defines the function as follows: norm2(x) = sqrt(dot(x , x))

The Inferno implementation doesn't appear to adhere to this see libmath/blas.c

double
norm2(int n, double *x)
{
    double  sum = 0;
    if (n <= 0) 
        return 0;
    while (n--) {
        sum += *x * *x;
        x++;
    }
    return sum;
}

Comments (1)

  1. Log in to comment