Browse Source

use huge_val not huge_valf for portability

tags/v0.3.21
Martin Kroeker GitHub 3 years ago
parent
commit
8e6f719ad3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      utest/test_dnrm2.c

+ 5
- 3
utest/test_dnrm2.c View File

@@ -35,17 +35,18 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if defined(BUILD_DOUBLE) #if defined(BUILD_DOUBLE)


#ifndef INFINITY #ifndef INFINITY
#define INFINITY HUGE_VALF
#define INFINITY HUGE_VAL
#endif #endif


CTEST(dnrm2,dnrm2_inf) CTEST(dnrm2,dnrm2_inf)
{ {
int i;
double x[29]; double x[29];
blasint incx=1; blasint incx=1;
blasint n=28; blasint n=28;
double res1=0.0f, res2=INFINITY; double res1=0.0f, res2=INFINITY;


for (int i=0;i<n;i++)x[i]=0.0f;
for (i=0;i<n;i++)x[i]=0.0f;
x[10]=-INFINITY; x[10]=-INFINITY;
res1=BLASFUNC(dnrm2)(&n, x, &incx); res1=BLASFUNC(dnrm2)(&n, x, &incx);
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS); ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
@@ -53,12 +54,13 @@ CTEST(dnrm2,dnrm2_inf)
} }
CTEST(dnrm2,dnrm2_tiny) CTEST(dnrm2,dnrm2_tiny)
{ {
int i;
double x[29]; double x[29];
blasint incx=1; blasint incx=1;
blasint n=28; blasint n=28;
double res1=0.0f, res2=0.0f; double res1=0.0f, res2=0.0f;


for (int i=0;i<n;i++)x[i]=7.457008414e-310;
for (i=0;i<n;i++)x[i]=7.457008414e-310;
res1=BLASFUNC(dnrm2)(&n, x, &incx); res1=BLASFUNC(dnrm2)(&n, x, &incx);
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS); ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
} }


Loading…
Cancel
Save