lua-users home
lua-l archive

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


On Wed, May 27, 2020 at 12:56 PM Philippe Verdy <verdyp@gmail.com> wrote:
>> > But the current implementation still uses it as the factor: (h<<5)+(h>>2) is the same as (h<<7 + h)>>>2 = (h*128+h)>>>2 = (h*129)>>>2; this way of writing it with the sum of shifts in two directions avoids discarding 2 high bits with (h<<7)
>> So, you affirm it is the same only to prove it is not the same in the same sentence?
> What??? I'm saying that they are arithmetically equivalent (you can check it yourself) if you ignore the limited bitlength. The difference is when integers have limited bitlength, because shifted bits will be discarded.

That's what I was saying.
1.-You say they are the same ( not arithmetically equivalent ), then
that one discards bits.
2.-I point if one discards bits they are not the same.
3.-You clarify that you are saying ( trying to say, or wanted to say )
is that they are arithmecally equivalent ignoring the limited bit
length. And talk about the limited bit length, which is unnecessary as
that was clearly implied in 1. Totally OK with that, but next time
please state it so beforehand so we do not get confused.

Francisco Olarte.