File tree Expand file tree Collapse file tree
src/Math-Tests-Polynomials Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,12 +40,15 @@ PMPolynomialTest >> testPolynomialAdditionIsCommutative [
4040PMPolynomialTest >> testPolynomialDerivative [
4141 " Code example 2.3"
4242
43- | polynomial expectedDerivative |
44- polynomial := (PMPolynomial coefficients: #( -3 7 2 1 ) ) derivative.
43+ | p derivative expectedDerivative |
44+ p := PMPolynomial coefficients: #( -3 7 2 1 ) .
45+
46+ derivative := p derivative.
47+
4548 expectedDerivative := PMPolynomial coefficients: #( 7 4 3 ) .
46- self assert: polynomial equals: expectedDerivative.
47- self assert: (polynomial at: 3 ) equals: 0 .
48- self assert: (polynomial at: 4 ) equals: 0
49+ self assert: derivative equals: expectedDerivative.
50+ self assert: (derivative at: 3 ) equals: 0 .
51+ self assert: (derivative at: 4 ) equals: 0
4952]
5053
5154{ #category : #' testing - division' }
You can’t perform that action at this time.
0 commit comments