From abf6a612deebccff8e52312497eecb3f9322240c Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Mon, 15 Jan 2024 22:30:17 +0000 Subject: [PATCH] test: demonstrated that sending raiseToInteger: with floating point number raises an Error. --- src/Math-Tests-Complex/PMComplexNumberTest.class.st | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index c8c3849e..3b7c9200 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -655,6 +655,13 @@ PMComplexNumberTest >> testRaisedToInteger [ self assert: c3 reciprocal equals: (c raisedToInteger: -3) ] +{ #category : #'testing - mathematical functions' } +PMComplexNumberTest >> testRaisedToIntegerWithFloats [ + |z| + z := 5 - 9 i. + self should: [ z raisedToInteger: 3.0 ] raise: ArithmeticError . +] + { #category : #'testing - mathematical functions' } PMComplexNumberTest >> testRaisedToNegativeInteger [ "