From ccd3076e4fda6939b636d8e52534abae9e4b745a Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Thu, 11 Jan 2024 22:51:21 +0000 Subject: [PATCH] test: added some missing tests. --- .../PMComplexNumberTest.class.st | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index fc6c0071..45b1b80b 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -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 | @@ -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 |