(42, all flavours) Integer Division - how?
|
12-14-2020, 06:01 PM
Post: #28
|
|||
|
|||
RE: (42, all flavours) Integer Division - how?
(12-14-2020 04:12 PM)Albert Chan Wrote: a = (a//b)*b + (a%b) = q*(c-1) + (a%b) I forget to show what happened if q is not correct. In other words, if q is correct, show: a%b - a%c - (q±1)%c ≠ 0 (mod c) Assumed what is to proof is actually true, subtract, we get: ±1 ≠ 0 (mod c) Since b > 0, c = b+1 > 1, this is always true ⇒ assumption is true too. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)