On 07/17/2009 12:10 AM, Nicolas Cellier wrote:
Too many lines of C for a source code analysis to my own taste :)
Maybe some very simple tests like:
self assert: 1.3q0 = (13/10) asFloatQ.
I wrote Float>>successor recently in Pharo, that can be a helper iin
such tests...
What about this instead:
predecessor
| exponent |
self isFinite ifFalse: [
(self isNaN or: [self negative]) ifTrue: [^self].
^Float fmax].
self = 0.0 ifTrue: [^Float fmin negated].
exponent := self exponent.
^exponent < self class emin
ifTrue: [self - Float fminDenormalized]
ifFalse: [self - (Float epsilon timesTwoPower: exponent)]
and likewise with s/-/+/ for successor?
Feel free to add these to Pharo.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk