Thread: overloading the division operator with Integer Class

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    167

    overloading the division operator with Integer Class

    I have an exercise to work on from a book. I have to overload some operators for a HugeInteger Class. I am having problems figuring out the division. The numbers are stored in an integer array. I am having trouble figuring out how to do division manually. Any tips that would get me started?
    silk.odyssey

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    So you don't know how to do long division by hand?

    gg

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    167
    I understand the method provided by the link but what I would like to know is if its possible to do the division using one digit from the divisor at a time because in the integer class each digit in a separate position in the array.
    silk.odyssey

  4. #4
    Registered User
    Join Date
    Dec 2003
    Posts
    167
    I have an idea of where I can start but it would require the overloading of a few more operators. I could use the relational operators to determine when the divident is larger than the divisor then basically try to emulate the long division procedure with code. Hope it works.
    silk.odyssey

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Default class template problem
    By Elysia in forum C++ Programming
    Replies: 5
    Last Post: 07-11-2008, 08:44 AM
  2. Replies: 16
    Last Post: 11-10-2007, 03:51 PM
  3. Overloading templated class operators
    By Artemis0583 in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2006, 12:30 PM
  4. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  5. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM