[Pkg] The Trunk: Kernel-dtl.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/Kernel-dtl.457.mcz

==================== Summary ====================

Name: Kernel-dtl.457
Author: dtl
Time: 3 June 2010, 9:30:53.666 pm
UUID: 9fefe953-125d-4872-b44c-8cddad771beb
Ancestors: Kernel-mtf.456, Kernel-nice.453

Merge Kernel-nice.453

=============== Diff against Kernel-mtf.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 Packages mailing list