Re: Difference between a+b and bit32.band(a+b)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Difference between a+b and bit32.band(a+b)
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2011年9月12日 12:55:01 -0300
> There are two possibilities. Either that was a mistake in the code
> (those other cases *should* be using it), or it is not logically
> necessary to do it for these temporary values in order to get the same
> final result, which is all that really matters.
Yes. Temporary values end up being used in a binary operation sooner or
later, so any extra bits resulting from overflows get cleared. These
"final" results, on the other way, are only being added to 'H'; these
'H' values never go through binary operations. After too many cycles,
the accumulation of overflows ends up causing problems (e.g., loosing
bits).
-- Roberto