#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Kuala Lumpur, MY
    Posts
    18
    Rep Power
    0

    Question multiplying big number


    Hi...
    Is there is any alorithm that exist to multiply two number which is a really˛ big number. let say the number is more than a billion??
  2. #2
  3. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,322
    Rep Power
    33
    Cant you work out things like that in your head?

    If am not sure if there is an algorithm for this. If i need to do it I just use a programming language like PHP or Perl to work it out and spit out the answer.
    - Andreas Koepke

    Koepke Photography

  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Posts
    465
    Rep Power
    14
    What is GMP?

    GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers. There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. GMP has a rich set of functions, and the functions have a regular interface.
    That should do it.
    Words must be weighed, not counted.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Greece
    Posts
    63
    Rep Power
    12
    Data Structs (list, queue or stacks) of characters that are actually 1-digit-integers and multiply the two numbers (in decimal form) with a carry,

    (like logical ports work).

    exmp.

    xxxx35
    xxxx52

    Carry=0;

    5*2+Carry=10;
    Carry=10/10;

    addtostruct(10-Carry);

    3*5+Carry = 16;
    Carry=16/10;

    addtostract(16-Carry);

    etc
    No sign

IMN logo majestic logo threadwatch logo seochat tools logo