[squeak-dev] The Inbox: Kernel-nice.1213.mcz

Alistair Grant akgrant0710 at gmail.com
Sat Feb 9 08:32:03 UTC 2019


On Fri, 8 Feb 2019 at 23:25, <commits at source.squeak.org> wrote:
>
> Provide a logarithm in base 2: log2.
> This (x log2) has an additional property that (x log: 2) has not: it is exact for exact powers of 2.
>
> While implementing LogarithmicInterval, I recently wanted to use log: 2, and this was getting as bad as in Python. See https://stackoverflow.com/questions/931995/inaccurate-logarithm-in-python/54537441#54537441

Slightly off topic... python3 has log2 :-)

$ python3
>>> from math import log2
>>> log2(2 ** 31)
31.0

Cheers,
Alistair


More information about the Squeak-dev mailing list