Maximum possible value of remainder

Discussion in 'Math' started by atferrari, Apr 18, 2007.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    To be used in a division routine (unsigned 32/16 bits) I am about to write.

    I would like to calculate what could be the maximum width (bits) of the remainder without having to run the calculation along all the possible values.

    Tried to do it somehow with Excel but found that I have not Solver available.

    I am afraid that answer is going to be simple and easy to obtain but I couldn't myself.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,142
    1,790
    The maximum size of the remainder in any division problem is the maximum divisor minus 1. If we are talking about a 16 bit unsigned divisor, it's maximum value is 65535 or ((2^16)-1). This would imply that the maximum remainder is 65534.
     
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    Thanks for the speedy reply, P B.
     
Loading...