[squeak-dev] The Trunk: Kernel-nice.1167.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 25 09:10:01 UTC 2018


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1167.mcz

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

Name: Kernel-nice.1167
Author: nice
Time: 25 April 2018, 11:09:01.928037 am
UUID: fd3a4e4a-925e-1842-9c73-f7f5736dd21c
Ancestors: Kernel-eem.1166

I shall not invoke super floorLog: with a different radix.

Ouch, probably a remnant from my ancestor method floorLog10 that I generalized.

=============== Diff against Kernel-eem.1166 ===============

Item was changed:
  ----- Method: Fraction>>floorLog: (in category 'mathematical functions') -----
  floorLog: radix
  	"Unlike super, this version is exact when radix is integer"
  	
  	| d n |
+ 	radix isInteger ifFalse: [^super floorLog: radix].
- 	radix isInteger ifFalse: [^super floorLog: 10].
  	n := numerator floorLog: radix.
  	d := denominator floorLog: radix.
  	^(numerator * (radix raisedTo: d))
  		< (denominator * (radix raisedTo: n))
  		ifTrue: [n - d - 1]
  		ifFalse: [n - d]!

Item was changed:
  ----- Method: Integer>>floorLog: (in category 'mathematical functions') -----
  floorLog: radix
  	"Unlike super, this version is exact when radix is integer"
  	
+ 	radix isInteger ifFalse: [^super floorLog: radix].
- 	radix isInteger ifFalse: [^super floorLog: 10].
  	self <= 0 ifTrue: [^DomainError signal: 'floorLog: is only defined for x > 0.0'].
  	^(self numberOfDigitsInBase: radix) - 1!



More information about the Squeak-dev mailing list