[squeak-dev] The Trunk: Kernel-nice.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/Kernel-nice.642.mcz

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

Name: Kernel-nice.642
Author: nice
Time: 19 October 2011, 10:11:56.9 pm
UUID: 26bbac76-79b8-4600-ac86-f60a02ad6da3
Ancestors: Kernel-nice.641

Correct my own bugs, (-3/2) log should raise a DomainError, not an infinite loop...

=============== Diff against Kernel-nice.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 Squeak-dev mailing list