2 ms·
> When you compare them, you choose signed or unsigned comparison. True. I've done a lot of assembler programming. Getting the right jxx instruction after a co
by WalterBright 4y ago
> When you compare them, you choose signed or unsigned comparison.
True. I've done a lot of assembler programming. Getting the right jxx instruction after a compare was a prolific source of bugs. I've had a lot fewer bugs with signed types :-)
> Plus the standard lib has specific functions for things like add with overflow which reflect what the CPU flags are doing.
D does, too:
https://dlang.org/phobos/core_checkedint.html https://dlang.org/phobos/core_checkedint.html
along with integer types that automatically check for overflow:
https://dlang.org/phobos/std_checkedint.html https://dlang.org/phobos/std_checkedint.html
- mypalmike 4y agoNice. I haven't really looked into D before but maybe I'll spend some time with it soon.