[squeak-dev] The Inbox: Kernel-ct.1412.mcz

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Sat Sep 18 13:16:51 UTC 2021


Thank you, Levente! :-)

---
Sent from Squeak Inbox Talk

On 2021-09-10T03:24:13+02:00, leves at caesar.elte.hu wrote:

> Hi Christoph,
> 
> On Tue, 7 Sep 2021, commits at source.squeak.org wrote:
> 
> > A new version of Kernel was added to project The Inbox:
> > http://source.squeak.org/inbox/Kernel-ct.1412.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-ct.1412
> > Author: ct
> > Time: 7 September 2021, 11:54:32.77151 pm
> > UUID: ca064a0e-13a5-f64f-ac9e-91ae045569a7
> > Ancestors: Kernel-eem.1408
> >
> > Adds non-performant but existing implementation of #isPowerOfTwo on Number. Now 16s isPowerOfTwo works as expected, too. Complements Kernel-nice.1377.
> >
> > =============== Diff against Kernel-eem.1408 ===============
> >
> > Item was added:
> > + ----- Method: Number>>isPowerOfTwo (in category 'testing') -----
> > + isPowerOfTwo
> > + 
> > +     ^ self strictlyPositive and: [(self log2 \\ 1) isZero]!
> 
> It's possible to create a Fraction for which that expression returns true. 
> For example (1 << 54 - 1) / (1 << 53).
> However, the method should return false for all Fractions due to 
> normalization.
> I pushed a simpler and probably faster solution based on inheritance to 
> the Inbox. See Kernel-ul.1410.
> 
> 
> Levente
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210918/8bfd87c1/attachment.html>


More information about the Squeak-dev mailing list