Skip to content

Commit 2e605e1

Browse files
Fix the behavior in srotg and drotg
1 parent 5f9e442 commit 2e605e1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

BLAS/SRC/drotg.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ subroutine DROTG( a, b, c, s )
118118
! ..
119119
anorm = abs(a)
120120
bnorm = abs(b)
121-
if( anorm == zero ) then
121+
if( bnorm == zero ) then
122+
c = one
123+
s = zero
124+
b = zero
125+
else if( anorm == zero ) then
122126
c = zero
123127
s = one
124128
a = b
125129
b = one
126-
else if( bnorm == zero ) then
127-
c = one
128-
s = zero
129-
b = zero
130130
else
131131
scl = min( safmax, max( safmin, anorm, bnorm ) )
132132
if( anorm > bnorm ) then

BLAS/SRC/srotg.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ subroutine SROTG( a, b, c, s )
118118
! ..
119119
anorm = abs(a)
120120
bnorm = abs(b)
121-
if( anorm == zero ) then
121+
if( bnorm == zero ) then
122+
c = one
123+
s = zero
124+
b = zero
125+
else if( anorm == zero ) then
122126
c = zero
123127
s = one
124128
a = b
125129
b = one
126-
else if( bnorm == zero ) then
127-
c = one
128-
s = zero
129-
b = zero
130130
else
131131
scl = min( safmax, max( safmin, anorm, bnorm ) )
132132
if( anorm > bnorm ) then

0 commit comments

Comments
 (0)