[A83] Re: Faster Multiplication


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

[A83] Re: Faster Multiplication




In accordance with the prophecy, Mike3465@aol.com uttered:

> 
> I don't know of a multiplication function that would be very fast at all for 
> large values for the smaller number.  *trying to figure out the code* uh.... 
> *inputting some variables to see....* *still not getting it*
> Wouldn't you have problems with adding hl to it self when h is the value you 
> want to multiply by?
> can you explain that a bit better? *still rather confused*
> Does that work for any number you input into it?

Does this help? The "o"s are zeroes that get shifted in from the right when you
add hl to itself.

00101100 * 10110111 = 

           10110111 * 0
          10110111o * 0
         10110111oo * 1
        10110111ooo * 1
       10110111oooo * 0
      10110111ooooo * 1
     10110111oooooo * 0
  + 10110111ooooooo * 0
-------------------------
         10110111oo
        10110111ooo
    + 10110111ooooo
    ---------------
      11111011101oo

= 1111101110100

Linus
--------------------------------------------- http://www.df.lth.se/~lft ---
Use wildcards. For example if you are searching for John Doe, you can search
for:
First Name: John
LastName: Doe
This will search for all users with the first name John and with a last name
Doe. 
-- "The ICQ Power Search" on www.icq.com




References: