(42, all flavours) Integer Division - how?
|
12-20-2020, 08:46 AM
Post: #48
|
|||
|
|||
RE: (42, all flavours) Integer Division - how?
(12-20-2020 02:14 AM)robve Wrote: Using the int function (or floor function), the quotient Q and remainder R of Y/X is simply: In unlimited arithmetic, yes. But it fails when Q is rounded up, or when Q*X carries more significant digits than the maximum (12 for a 42S or 34 for Free42). For instance: 42S: Y: 1e12 X: 6 Y: 9.8696044e21 X: 31415926536 You might consider these examples farfetched and contrived, but when you try to implement a multiprecision division (as I mentioned in one of the previous posts here), it is what you need to get right. Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)