Thread: Storing a very long number

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by grumpy View Post
    Someone who manages to compute 4*4 as 8 almost certainly has a problem with precision.
    Maybe they used C++ and overloaded the * operator to add instead!

    I got to use the same joke twice in 10 minutes!


    Quzah.
    Hope is the first step on the road to disappointment.

  2. #17
    1337
    Join Date
    Jul 2008
    Posts
    135
    Thank you. I am kinda forget mathematics from school. Used to calculators.

  3. #18
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by valthyx View Post
    Thank you. I am kinda forget mathematics from school. Used to calculators.
    You used calculators for evaluating 4*4 ? Maybe ( this ) will help !
    Last edited by manasij7479; 08-08-2011 at 05:06 AM.

  4. #19
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by valthyx View Post
    Thank you. I am kinda forget mathematics from school. Used to calculators.
    C programmers don't use calculators ... we WRITE calculators!

  5. #20
    Registered User
    Join Date
    Mar 2009
    Posts
    344
    Quote Originally Posted by grumpy View Post
    Someone who manages to compute 4*4 as 8 almost certainly has a problem with precision.
    It's correct for sufficiently large values of 8.

    I'd agree with others about getting addition working first. Then an easy, if slow, implementation of multiplication can be performed using repeated addition. I.e. 4 * 4 => for (i = sum = 0; i < m2; i++) sum = add(m1,sum);

    Get that working before going on to any of the improvements mentioned in Multiplication algorithm - Wikipedia, the free encyclopedia

  6. #21
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by KCfromNC View Post
    It's correct for sufficiently large values of 8.
    The value of 8 (the arabic, hindu numeral, or hindu-arabic numeral) is defined and immutable.

    I suppose we could define 8 to have a different value, for example by introducing some other numeric system. However, the context of the discussion here suggests such an alternate numeric system was not being considered.

    As such, your statement is crap.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  7. #22
    1337
    Join Date
    Jul 2008
    Posts
    135
    Thanks for all the help and "cheers". I am working on asymmetric encryption.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Storing a number in an array
    By C++ student in forum C++ Programming
    Replies: 4
    Last Post: 09-28-2009, 08:47 AM
  2. Storing components of a complex number
    By cashmerelc in forum C Programming
    Replies: 6
    Last Post: 11-19-2007, 01:37 PM
  3. Long (really long) number
    By Doriän in forum C Programming
    Replies: 5
    Last Post: 09-10-2007, 03:27 PM
  4. Storing long strings?
    By thebudbottle in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2005, 06:10 PM
  5. Storing the whole number
    By flip114 in forum C Programming
    Replies: 3
    Last Post: 10-21-2003, 08:50 AM