On Thursday, 28 October 2021 at 21:23:15 UTC, kyle wrote:
I stumbled into this fun today. I understand why abs yields a negative value here with overflow and no promotion. I just want to know if it should. Should abs ever return a negative number? Thanks.
D has defined signed integers to be modular, so it represent numbers mapped to a circle rather than a line.
Is that a good idea? No, but that is what you have.