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

Juan Vuletich juan at jvuletich.org
Fri Oct 14 21:05:00 UTC 2011


Thanks for reviewing and integrating all this, Nicolas! And for fixing 
ScaledDecimal, that is not included in Cuis.

Note that the check for being an even power of two (great idea BTW) is 
implicit in most of the tests already done, so this is enough:

    ...
    Also, the receiver must be an aven power of two.
    This needs additional testing in the 00 suffix,
    as it implied in all the other conditions"
    | lsb |
    lsb := self digitAt: 1.
    ^(lsb = 0 and: [ self lowBit odd ])        "00 (and even power of 2)"
        or: [ lsb = 16r40                    "40"
        or: [ (lsb bitAnd: 16r7) = 1            "any|1 or any|9"
        or: [ (lsb bitAnd: 16r1F) = 4            "even|4"
        or: [ (lsb bitAnd: 16r7F) = 16 ]]]]    "10 or 90"

Cheers,
Juan Vuletich

commits at source.squeak.org wrote:
> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.637.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.637
> Author: nice
> Time: 14 October 2011, 10:28:53.269 pm
> UUID: 90981f89-5348-4bf9-8981-4cc51da6bc29
> Ancestors: Kernel-nice.636
>
> Implement ScaledDecimal>>nthRoot:
> #mightBeASquare now verifies whether the receiver is an even power of two.
>
> =============== Diff against Kernel-nice.636 ===============
>
> ...
>  




More information about the Squeak-dev mailing list