workaround fault with ssq=inf,scale=0

This commit is contained in:
Martin Kroeker 2022-07-02 23:47:17 +02:00 committed by GitHub
parent 3df3d622eb
commit 9e29598575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -404,6 +404,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
#else #else
nrm2_compute(n, x, inc_x, &ssq, &scale); nrm2_compute(n, x, inc_x, &ssq, &scale);
#endif #endif
if (fabs(scale) <1.e-300) return 0.;
ssq = sqrt(ssq) * scale; ssq = sqrt(ssq) * scale;
return ssq; return ssq;