At 12:23 PM 2/11/00 -0600, you wrote:
>Okay, I was sitting there the other day thinking about a non-FFT squaring
>algorithm...
>
>Say we have 14, which in binary is 1110...
>
>If we left shift this by the position of the 1, for each 1 in the binary
>representation, and add them together, we should get the square... So to
>square 14, we do this:
>1110 << 3      == 1110000 +
>1110 << 2      == 0111000 +
>1110 << 1      == 0011100 +
>               == 11000100 which is 196
>

In other words you are saying

14*14 = 14*(8 + 4 + 2) = 14*8 + 14*4 + 14*2

or in base 10

14*14 = 14*(10 + 4) = 14*10 + 14*4

Your logic appears correct, but it appears to be a computer base 2
implementation of what we do longhand in base 10.

You are just taking advantage of the fact that multiplying by 2 is base 2 is
a position shift, just like it is real easy in base 10 for us to take
1234 * 100 = 123400







_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to