File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -619,11 +619,15 @@ PMComplexTest >> testSinh [
619619
620620{ #category : #tests }
621621PMComplexTest >> testSquareRootOfANegativeRealNumberIsPureImaginary [
622+
622623 " Given z = -4 + 0 i, the square root is 2 i"
623-
624- | squareRoot |
625- squareRoot := (PMComplex real: - 4 imaginary: 0 ) sqrt .
626- self assert: squareRoot equals: 2 i.
624+
625+ | squareRoot z |
626+ z := PMComplex real: - 4 imaginary: 0 .
627+
628+ squareRoot := z sqrt.
629+
630+ self assert: squareRoot equals: 2 i
627631]
628632
629633{ #category : #tests }
@@ -670,10 +674,12 @@ PMComplexTest >> testSquareRootOfPositiveRealNumberIsAComplexNumberWithOnlyAReal
670674
671675 " Given z = 6 + 0 i, then root z = root 6"
672676
673- | squareRoot expected |
674- squareRoot := ( PMComplex real: 6 imaginary: 0 ) sqrt .
677+ | squareRoot expected positiveRealNumber |
678+ positiveRealNumber := PMComplex real: 6 imaginary: 0 .
675679
676- expected := PMComplex real: (6 sqrt) imaginary: 0 .
680+ squareRoot := positiveRealNumber sqrt.
681+
682+ expected := PMComplex real: 6 sqrt imaginary: 0 .
677683 self assert: squareRoot equals: expected
678684]
679685
You can’t perform that action at this time.
0 commit comments