Skip to content

Commit 5362c64

Browse files
committed
One more batch of #defaultNumericalPrecision removed
1 parent c56f93c commit 5362c64

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/Math-Core-Process/PMIterativeProcess.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ PMIterativeProcess >> precision [
125125
{ #category : #information }
126126
PMIterativeProcess >> precisionOf: aNumber1 relativeTo: aNumber2 [
127127

128-
^aNumber2 > PMFloatingPointMachine new defaultNumericalPrecision
129-
ifTrue: [ aNumber1 / aNumber2]
130-
ifFalse:[ aNumber1]
128+
^ aNumber2 > Float defaultComparisonPrecision
129+
ifTrue: [ aNumber1 / aNumber2 ]
130+
ifFalse: [ aNumber1 ]
131131
]
132132

133133
{ #category : #information }

src/Math-Numerical/PMOneVariableFunctionOptimizer.class.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ Class {
99

1010
{ #category : #information }
1111
PMOneVariableFunctionOptimizer class >> defaultPrecision [
12-
"Private"
13-
^PMFloatingPointMachine new defaultNumericalPrecision * 10
12+
"Private"
13+
14+
^ Float defaultComparisonPrecision * 10
1415
]
1516

1617
{ #category : #information }

src/Math-Numerical/PMSimplexOptimizer.class.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ Class {
99

1010
{ #category : #information }
1111
PMSimplexOptimizer class >> defaultPrecision [
12-
"Private"
13-
^PMFloatingPointMachine new defaultNumericalPrecision * 1000
12+
"Private"
13+
14+
^ Float defaultComparisonPrecision * 1000
1415
]
1516

1617
{ #category : #operation }

src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,15 +842,15 @@ PMNumericalMethodsTestCase >> testOptimizeSimplex [
842842

843843
| fBlock simplex educatedGuess result |
844844
fBlock := [ :x | (x * x) negated exp ].
845-
educatedGuess := #(0.5 1.0 0.5) asPMVector.
845+
educatedGuess := #( 0.5 1.0 0.5 ) asPMVector.
846846
simplex := PMSimplexOptimizer maximizingFunction: fBlock.
847847
simplex initialValue: educatedGuess.
848848
simplex desiredPrecision: 1.0e-6.
849849
result := simplex evaluate.
850850
self assert: simplex precision < 1.0e-6.
851-
self assert: (result at: 1) abs < 1.0e-6.
852-
self assert: (result at: 2) abs < 1.0e-6.
853-
self assert: (result at: 3) abs < 1.0e-6
851+
self assert: (result at: 1) closeTo: 0.
852+
self assert: (result at: 2) closeTo: 0.
853+
self assert: (result at: 3) closeTo: 0
854854
]
855855

856856
{ #category : #statistics }

0 commit comments

Comments
 (0)