Skip to content

Commit

Permalink
test: added some missing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemalvarambhia committed Jan 11, 2024
1 parent af69a66 commit ccd3076
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Math-Tests-Complex/PMComplexNumberTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,15 @@ PMComplexNumberTest >> testRaisedTo [
self assert: c3 imaginary closeTo: c imaginary
]

{ #category : #tests }
PMComplexNumberTest >> testRaisedToFractionalPower [

| z expected |
z := 0 + 1 i.
expected := 3 sqrt / 2 + (1 / 2) i.
self assert: (z raisedTo: 1 / 3) closeTo: expected
]

{ #category : #'testing - mathematical functions' }
PMComplexNumberTest >> testRaisedToInteger [
| c c3 |
Expand All @@ -646,6 +655,13 @@ PMComplexNumberTest >> testRaisedToInteger [
self assert: c3 reciprocal equals: (c raisedToInteger: -3)
]

{ #category : #'testing - mathematical functions' }
PMComplexNumberTest >> testRaisedToNegativeInteger [
| z |
z := (3 sqrt / 2) + (1 / 2) i.
self assert: (z raisedTo: -3) closeTo: (0 - 1 i).
]

{ #category : #'testing - mathematical functions' }
PMComplexNumberTest >> testRaisedToPositiveInteger [
| z zCubed |
Expand Down

0 comments on commit ccd3076

Please sign in to comment.