File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -626,6 +626,19 @@ PMComplexTest >> testSquareRootOfANegativeRealNumberIsPureImaginary [
626626 self assert: squareRoot equals: 2 i.
627627]
628628
629+ { #category : #tests }
630+ PMComplexTest >> testSquareRootOfNegativePureImaginaryNumberIsAComplexNumberWithRealAndImaginaryParts [
631+ | squareRoot expected pureImaginaryNumber |
632+ pureImaginaryNumber := PMComplex real: 0 imaginary: - 4 .
633+
634+ squareRoot := pureImaginaryNumber sqrt.
635+
636+ expected := 2 sqrt negated + 2 sqrt i.
637+ self assert: squareRoot real closeTo: expected real.
638+ self assert: squareRoot imaginary closeTo: expected imaginary
639+
640+ ]
641+
629642{ #category : #tests }
630643PMComplexTest >> testSquareRootOfPositivePureImaginaryNumberIsAComplexNumberWithRealAndImaginaryParts [
631644
You can’t perform that action at this time.
0 commit comments