Skip to content

Commit 83860b8

Browse files
Inlined a method. We'll need to add tests before refactoring this method.
1 parent 57b79ab commit 83860b8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Math-Complex/PMComplex.class.st

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,6 @@ PMComplex >> isNumber [
557557
^ true
558558
]
559559

560-
{ #category : #testing }
561-
PMComplex >> isReal [
562-
563-
^ imaginary = 0 and: [ real >= 0 ]
564-
]
565-
566560
{ #category : #testing }
567561
PMComplex >> isZero [
568562
^ real isZero and: [imaginary isZero]
@@ -717,7 +711,8 @@ PMComplex >> sqrt [
717711
"Return the square root of the receiver with a positive imaginary part."
718712

719713
| u v |
720-
self isReal ifTrue: [ ^ self class real: real sqrt imaginary: 0 ].
714+
(imaginary = 0 and: [ real >= 0 ]) ifTrue: [
715+
^ self class real: real sqrt imaginary: 0 ].
721716
v := (self abs - real / 2) sqrt.
722717
u := imaginary / 2 / v.
723718
^ self class real: u imaginary: v

0 commit comments

Comments
 (0)