Maximum possible value of remainder

Thread Starter

atferrari

Joined Jan 6, 2004
3,930
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.
 

Papabravo

Joined Feb 24, 2006
13,565
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.
 
Top