Skip to content

Commit e3a4880

Browse files
author
Weslley da Silva Pereira
committed
use /= instead of isnan
1 parent 50dc1bf commit e3a4880

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

BLAS/SRC/icamax.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ integer function icamax(n, x, incx)
103103
if (incx == 1) then
104104
! code for increment equal to 1
105105
do i = 1, n
106-
if (isnan(real(x(i))) .or. isnan(imag(x(i)))) then
106+
if (x(i) /= x(i)) then
107107
! return when first NaN found
108108
icamax = i
109109
return
110110
elseif (abs(real(x(i))) > hugeval .or. abs(imag(x(i))) > hugeval) then
111111
! keep looking for first NaN
112112
do j = i+1, n
113-
if (isnan(real(x(j))) .or. isnan(imag(x(j)))) then
113+
if (x(j) /= x(j)) then
114114
! return when first NaN found
115115
icamax = j
116116
return
@@ -144,15 +144,15 @@ integer function icamax(n, x, incx)
144144
! code for increment not equal to 1
145145
ix = 1
146146
do i = 1, n
147-
if (isnan(real(x(ix))) .or. isnan(imag(x(ix)))) then
147+
if (x(ix) /= x(ix)) then
148148
! return when first NaN found
149149
icamax = i
150150
return
151151
elseif (abs(real(x(ix))) > hugeval .or. abs(imag(x(ix))) > hugeval) then
152152
! keep looking for first NaN
153153
jx = ix + incx
154154
do j = i+1, n
155-
if (isnan(real(x(jx))) .or. isnan(imag(x(jx)))) then
155+
if (x(jx) /= x(jx)) then
156156
! return when first NaN found
157157
icamax = j
158158
return

BLAS/SRC/izamax.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ integer function izamax(n, x, incx)
103103
if (incx == 1) then
104104
! code for increment equal to 1
105105
do i = 1, n
106-
if (isnan(real(x(i))) .or. isnan(imag(x(i)))) then
106+
if (x(i) /= x(i)) then
107107
! return when first NaN found
108108
izamax = i
109109
return
110110
elseif (abs(real(x(i))) > hugeval .or. abs(imag(x(i))) > hugeval) then
111111
! keep looking for first NaN
112112
do j = i+1, n
113-
if (isnan(real(x(j))) .or. isnan(imag(x(j)))) then
113+
if (x(j) /= x(j)) then
114114
! return when first NaN found
115115
izamax = j
116116
return
@@ -144,15 +144,15 @@ integer function izamax(n, x, incx)
144144
! code for increment not equal to 1
145145
ix = 1
146146
do i = 1, n
147-
if (isnan(real(x(ix))) .or. isnan(imag(x(ix)))) then
147+
if (x(ix) /= x(ix)) then
148148
! return when first NaN found
149149
izamax = i
150150
return
151151
elseif (abs(real(x(ix))) > hugeval .or. abs(imag(x(ix))) > hugeval) then
152152
! keep looking for first NaN
153153
jx = ix + incx
154154
do j = i+1, n
155-
if (isnan(real(x(jx))) .or. isnan(imag(x(jx)))) then
155+
if (x(jx) /= x(jx)) then
156156
! return when first NaN found
157157
izamax = j
158158
return

0 commit comments

Comments
 (0)