(42, all flavours) Integer Division - how?
|
12-13-2020, 01:18 PM
Post: #14
|
|||
|
|||
RE: (42, all flavours) Integer Division - how?
(12-13-2020 01:24 AM)Albert Chan Wrote: return q + r We had assumed q never overflow, which results in |r| ≤ 1 However, if q already overflowed, calculated r is basically garbage. We should return q + sign(r), to limit the damage. In other words, if q overflow calculator precision, don't correct the quotient. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)