Skip to content

Commit

Permalink
refactor: extracted magic number and integrand to local variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemalvarambhia committed Dec 28, 2023
1 parent 4b89858 commit 63b3779
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ PMPolynomialTest >> testPolynomialIntegral [
PMPolynomialTest >> testPolynomialIntegralWithConstant [
"Code example 2.3"

| polynomial |
polynomial := (PMPolynomial coefficients: #(-3 7 2 1)) integral: 5.
| polynomial arbitraryConstant p |
arbitraryConstant := 5.
p := PMPolynomial coefficients: #( -3 7 2 1 ).
polynomial := p integral: arbitraryConstant.
self assert: (polynomial at: 0) equals: 5.
self assert: (polynomial at: 1) equals: -3.
self assert: (polynomial at: 2) equals: 7 / 2.
Expand Down

0 comments on commit 63b3779

Please sign in to comment.