(42, all flavours) Integer Division - how?
|
12-17-2020, 10:03 PM
(This post was last modified: 12-17-2020 10:29 PM by Albert Chan.)
Post: #38
|
|||
|
|||
RE: (42, all flavours) Integer Division - how?
(12-17-2020 06:41 PM)Albert Chan Wrote: If Cc00/Xx fractional part is 0.5, it implied Cc000 / Xx is integer, ends in 5. (12-17-2020 07:50 PM)Werner Wrote: No.. each 0 is the length of a half integer, so for a 12 digit machine it is 000000 and for Free42/DM42 it's 17 zeroes ;-) I misunderstood. "0" = h zeroes, not 1 zero (*) But, the logic holds. Just replace "hidden" 1 with h \(\large{CcOO \over Xx}\) is half-way cases → \(Xx = 2^{2h+1} \cdot k\) \(\large{CcOO\;±\;IOO \over Xx}\) will *not* be half-way case, since \( \large{10^{2h} \over 2^{2h+1}} = {5^{2h} \over 2}\), not an integer. Gap test work with with "half-integers" too. (*) I had assumed "0" = 1 zero, on a 2-digit calculator, and checked how the code perform. Code: Cases % Types |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)