[squeakdev] The Trunk: Kerneldtl.457.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Jun 4 01:34:06 UTC 2010
David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kerneldtl.457.mcz
==================== Summary ====================
Name: Kerneldtl.457
Author: dtl
Time: 3 June 2010, 9:30:53.666 pm
UUID: 9fefe953125d4872b44c8cddad771beb
Ancestors: Kernelmtf.456, Kernelnice.453
Merge Kernelnice.453
=============== Diff against Kernelmtf.456 ===============
Item was added:
+  Method: Integer>>ln (in category 'mathematical functions') 
+ ln
+ "This function is defined because super ln might overflow."
+  res h 
+ self <= 0 ifTrue: [self error: 'ln is only defined for x > 0'].
+ res := super ln.
+ res isFinite ifTrue: [^res].
+ h := self highBit.
+ ^2 ln * h + (self / (1 << h)) asFloat ln!
Item was added:
+  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: [self error: 'ln is only defined for x > 0'].
+ res := super ln.
+ res isFinite ifTrue: [^res].
+ int := self integerPart.
+ ^int ln + (self / int) ln!
More information about the Squeakdev
mailing list
