@@ -22,7 +22,6 @@ Class {
2222 ' defaultNumericalPrecision' ,
2323 ' machinePrecision' ,
2424 ' negativeMachinePrecision' ,
25- ' smallestNumber' ,
2625 ' smallNumber' ,
2726 ' largestExponentArgument'
2827 ],
@@ -72,25 +71,6 @@ PMFloatingPointMachine >> computeNegativeMachinePrecision [
7271 tmp - one = zero ] whileFalse: [ negativeMachinePrecision := negativeMachinePrecision * inverseRadix ]
7372]
7473
75- { #category : #information }
76- PMFloatingPointMachine >> computeSmallestNumber [
77-
78- | one floatingRadix inverseRadix fullMantissaNumber |
79- one := 1 asFloat.
80- floatingRadix := Float radix asFloat.
81- inverseRadix := one / floatingRadix.
82- fullMantissaNumber := one - (floatingRadix * self negativeMachinePrecision).
83- smallestNumber := fullMantissaNumber.
84- [
85- [
86- fullMantissaNumber := fullMantissaNumber * inverseRadix.
87- fullMantissaNumber = 0.0 ifTrue: [ Error signal ].
88- smallestNumber := fullMantissaNumber.
89- true ] whileTrue: [ ] ]
90- on: Error
91- do: [ :signal | signal return: nil ]
92- ]
93-
9474{ #category : #information }
9575PMFloatingPointMachine >> defaultNumericalPrecision [
9676
@@ -125,40 +105,9 @@ PMFloatingPointMachine >> negativeMachinePrecision [
125105 ^ negativeMachinePrecision
126106]
127107
128- { #category : #display }
129- PMFloatingPointMachine >> showParameters [
130-
131- Transcript
132- cr;
133- cr;
134- nextPutAll: ' Floating-point machine parameters' ;
135- cr;
136- nextPutAll: ' ---------------------------------' .
137- Transcript
138- cr;
139- nextPutAll: ' Machine precision: ' .
140- self machinePrecision printOn: Transcript .
141- Transcript
142- cr;
143- nextPutAll: ' Negative machine precision: ' .
144- self negativeMachinePrecision printOn: Transcript .
145- Transcript
146- cr;
147- nextPutAll: ' Smallest number: ' .
148- self smallestNumber printOn: Transcript .
149- Transcript flush
150- ]
151-
152108{ #category : #information }
153109PMFloatingPointMachine >> smallNumber [
154110
155- smallNumber ifNil: [ smallNumber := self smallestNumber sqrt ].
111+ smallNumber ifNil: [ smallNumber := Float fmin sqrt ].
156112 ^ smallNumber
157113]
158-
159- { #category : #information }
160- PMFloatingPointMachine >> smallestNumber [
161-
162- smallestNumber ifNil: [ self computeSmallestNumber ].
163- ^ smallestNumber
164- ]
0 commit comments