File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -637,6 +637,15 @@ PMComplexNumberTest >> testRaisedTo [
637637 self assert: c3 imaginary closeTo: c imaginary
638638]
639639
640+ { #category : #tests }
641+ PMComplexNumberTest >> testRaisedToFractionalPower [
642+
643+ | z expected |
644+ z := 0 + 1 i.
645+ expected := 3 sqrt / 2 + (1 / 2 ) i.
646+ self assert: (z raisedTo: 1 / 3 ) closeTo: expected
647+ ]
648+
640649{ #category : #' testing - mathematical functions' }
641650PMComplexNumberTest >> testRaisedToInteger [
642651 | c c3 |
@@ -646,6 +655,13 @@ PMComplexNumberTest >> testRaisedToInteger [
646655 self assert: c3 reciprocal equals: (c raisedToInteger: - 3 )
647656]
648657
658+ { #category : #' testing - mathematical functions' }
659+ PMComplexNumberTest >> testRaisedToNegativeInteger [
660+ | z |
661+ z := (3 sqrt / 2 ) + (1 / 2 ) i.
662+ self assert: (z raisedTo: - 3 ) closeTo: (0 - 1 i).
663+ ]
664+
649665{ #category : #' testing - mathematical functions' }
650666PMComplexNumberTest >> testRaisedToPositiveInteger [
651667 | z zCubed |
You can’t perform that action at this time.
0 commit comments