It seems like reversible mul/div operations on integers invariably need 3 parameters to be reversible. This is breaking my mind a bit.
Conversation
Notices
-
Devine Lu Ator (neauoire@merveilles.town)'s status on Wednesday, 28-Dec-2022 04:19:13 JST Devine Lu Ator -
Devine Lu Ator (neauoire@merveilles.town)'s status on Wednesday, 28-Dec-2022 04:19:10 JST Devine Lu Ator So what happens if the 3 numbers do not create a whole number, does it ... error?
Adrian Cochrane repeated this. -
Devine Lu Ator (neauoire@merveilles.town)'s status on Wednesday, 28-Dec-2022 04:19:11 JST Devine Lu Ator This brings me back to fractions somehow. Is a fraction reduction (6/8 -> 3/4) a loss of entropy?
There's no loss of quantity, but programmatically, a knowledge of the distribution of that value is lost..
Adrian Cochrane repeated this. -
Devine Lu Ator (neauoire@merveilles.town)'s status on Wednesday, 28-Dec-2022 04:19:12 JST Devine Lu Ator Before doing your multiplication, you must know the remainder beforehand if you know you're not going to have a resulting whole number.. what
-
infra (1011x@toot.cat)'s status on Wednesday, 28-Dec-2022 14:20:21 JST infra @neauoire i made a PL called rever, and the way division was implemented was by calculating both the dividend (I think that's the name; basically the whole number portion) and the remainder. it was a procedure called divmod, which took the 3 inputs (total, zero, divisor) and returned 3 outputs (remainder, dividend, divisor), the running it backwards would give you multiply-add. that's the only way I could see to implement multiplication and division reversibly.
-