[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Counting bits from the other end



Quoting Bennett Todd (bet@rahul.net):
> That's stone cool! A quick search suggests that 37 is the smallest n
> for which that trick works for 32-bit words; however, either the
> smallest such divisor for a 64-bit wordsize is _gigantic_, or else
> perl on a 32-bit platform can't compute it with the attached search
> script.

primes 64 | head -1
67

Sometimes Perl is no substitute for a Maths degree :-)

-- 
Adam Rice -- wysiwyg@glympton.airtime.co.uk -- Blackburn, Lancashire, England

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe