Browse Source

check for zero inc

tags/v0.3.27
kseniyazaytseva 2 years ago
parent
commit
c6f30fd414
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      interface/max.c

+ 20
- 0
interface/max.c View File

@@ -46,6 +46,12 @@

#ifdef USE_ABS

#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif

#ifndef USE_MIN

/* ABS & MAX */
@@ -92,6 +98,8 @@

#else

#define ABS

#ifndef USE_MIN

/* MAX */
@@ -130,6 +138,12 @@ FLOATRET NAME(blasint *N, FLOAT *x, blasint *INCX){

if (n <= 0) return 0;

#ifndef COMPLEX
if (incx == 0) return (ABS(*x));
#else
if (incx == 0) return (ABS(*x) + ABS(*(x+1)));
#endif

IDEBUG_START;

FUNCTION_PROFILE_START();
@@ -158,6 +172,12 @@ FLOAT CNAME(blasint n, FLOAT *x, blasint incx){

if (n <= 0) return 0;

#ifndef COMPLEX
if (incx == 0) return (ABS(*x));
#else
if (incx == 0) return (ABS(*x) + ABS(*(x+1)));
#endif

IDEBUG_START;

FUNCTION_PROFILE_START();


Loading…
Cancel
Save