From 6f5698adf3d480f1eb067ec7da33b4475a1f7553 Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Sat, 6 Jan 2024 18:20:36 +0000 Subject: [PATCH] refactor: renamed some local variables and performed a simpler computation. --- src/Math-Tests-Complex/PMComplexNumberTest.class.st | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index 95c377f4..e14e7e91 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -630,11 +630,12 @@ PMComplexNumberTest >> testQuotientsOfComplexNumbersCannotBeWritten [ { #category : #'testing - mathematical functions' } PMComplexNumberTest >> testRaisedTo [ - | c c3 | + | c squareRootOfZSquared z | c := 5 - 6 i. - c3 := (c raisedTo: 0.2) raisedTo: 5. - self assert: c3 real closeTo: c real. - self assert: c3 imaginary closeTo: c imaginary + z := 5 - 6 i. + squareRootOfZSquared := (c raisedTo: 1 / 2) raisedTo: 2. + self assert: squareRootOfZSquared real closeTo: c real. + self assert: squareRootOfZSquared imaginary closeTo: c imaginary ] { #category : #'testing - mathematical functions' }