Follow

@amiloradovsky@functional.cafe @gassahara@mstdn.io I'm not talking about bignum algebra, I'm talking about arithmetic. Multiplication of two digits should return two digits, it is simply natural for multiplication. The two digits returned do not magically multiply to 4, that's out of scope. If you want to discard the higher digit for your specific use case or raise an error when higher digit is set, you are free to do so. Someone else might want to discard the lower or implement further multiplication or specific error handling based on the amount of overflow.

The problem with casting to a (virtual) wider type, is that it implies existence of the wider type on which you can do further arithmetic, and for which a wider type does not exist. It's an edge case and not a generic interface for arithmetic.

· · SubwayTooter · 1 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.