We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57b79ab commit 83860b8Copy full SHA for 83860b8
src/Math-Complex/PMComplex.class.st
@@ -557,12 +557,6 @@ PMComplex >> isNumber [
557
^ true
558
]
559
560
-{ #category : #testing }
561
-PMComplex >> isReal [
562
-
563
- ^ imaginary = 0 and: [ real >= 0 ]
564
-]
565
566
{ #category : #testing }
567
PMComplex >> isZero [
568
^ real isZero and: [imaginary isZero]
@@ -717,7 +711,8 @@ PMComplex >> sqrt [
717
711
"Return the square root of the receiver with a positive imaginary part."
718
712
719
713
| 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 ].
721
716
v := (self abs - real / 2) sqrt.
722
u := imaginary / 2 / v.
723
^ self class real: u imaginary: v
0 commit comments