Re: A86: Z80 & new game preview


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

Re: A86: Z80 & new game preview




At 16:55 1999-11-28 -0700, you wrote:
>
>since it cancels algebraicly, that means it doesn't matter. seriously. in
>fact, i was kind of doubting myself so i brute-force tested the algorithm
>and worked (compared it's output to a brute force routine).

I think it's pretty obvious why it works. Since you know that the result to
(a+b)^2-(a-b)^2 _WILL_ be divisble by 4 (since a*b is always an integer...),
it gives that the last two bits of the result is 0, thus the last two
bits of (a+b)^2 and (a-b)^2 will _always_ be the same. Thus you can
skip those bits in the table.


--
Jimmy Mårdell                   "God made machine language;
mailto:yarin@acc.umu.se          all the rest is the work of man."
http://www.acc.umu.se/~yarin/    



References: