From af69a6694df67a70c85e0487951b41c2d8899504 Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Thu, 11 Jan 2024 18:56:14 +0000 Subject: [PATCH] test: added a test for positive integer. --- src/Math-Tests-Complex/PMComplexNumberTest.class.st | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index efddcf78..fc6c0071 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -646,6 +646,14 @@ PMComplexNumberTest >> testRaisedToInteger [ self assert: c3 reciprocal equals: (c raisedToInteger: -3) ] +{ #category : #'testing - mathematical functions' } +PMComplexNumberTest >> testRaisedToPositiveInteger [ + | z zCubed | + z := (3 sqrt / 2) + (1 / 2) i. + zCubed := (z raisedTo: 3) . + self assert: zCubed closeTo: (0 + 1 i). +] + { #category : #tests } PMComplexNumberTest >> testRandom [ | random c r |