[squeakdev] The Trunk: Kernelnice.642.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Oct 19 20:12:46 UTC 2011
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernelnice.642.mcz
==================== Summary ====================
Name: Kernelnice.642
Author: nice
Time: 19 October 2011, 10:11:56.9 pm
UUID: 26bbac7679b84600ac86f60a02ad6da3
Ancestors: Kernelnice.641
Correct my own bugs, (3/2) log should raise a DomainError, not an infinite loop...
=============== Diff against Kernelnice.641 ===============
Item was changed:
 Method: Fraction>>ln (in category 'mathematical functions') 
ln
"This function is defined because super ln might overflow.
Note that < 1 is tested before converting to float in order to avoid precision loss due to gradual underflow."
 res int 
 self < 1 ifTrue: [^self reciprocal ln negated].
self <= 0 ifTrue: [DomainError signal: 'ln is only defined for x > 0'].
+ self < 1 ifTrue: [^self reciprocal ln negated].
res := super ln.
res isFinite ifTrue: [^res].
int := self integerPart.
^int ln + (self / int) ln!
Item was changed:
 Method: Fraction>>log (in category 'mathematical functions') 
log
"This function is defined because super log might overflow.
Note that < 1 is tested before converting to float in order to avoid precision loss due to gradual underflow."
 res int 
 self < 1 ifTrue: [^self reciprocal log negated].
self <= 0 ifTrue: [DomainError signal: 'log is only defined for x > 0'].
+ self < 1 ifTrue: [^self reciprocal log negated].
res := super log.
res isFinite ifTrue: [^res].
int := self integerPart.
^int log + (self / int) log!
More information about the Squeakdev
mailing list
