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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Apr 27 09:13:07 UTC 2018


Hmm, I already corrected this in 2016, in Kernel-nice.1017
But then I broke it in  Kernel-nice.1018 when merging another Kernel-nice.
1017 which I posted in the inbox...
Messy...

2018-04-25 11:10 GMT+02:00 <commits at source.squeak.org>:

> 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!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180427/052cb7a3/attachment.html>


More information about the Squeak-dev mailing list