You are a stupid programmer, you can't have that

Adam D Ruppe destructionator at gmail.com
Mon Aug 9 22:01:33 UTC 2021


On Monday, 9 August 2021 at 21:05:05 UTC, H. S. Teoh wrote:
> Indeed!  If you look at the assembly level, unsigned arithmetic 
> is the one with straightforward instructions mapping 1-to-1 
> with arithmetic operations, whereas signed arithmetic is the 
> one that involves carry bits and other such additional 
> complications.

They're literally identical for most operations; you can use the 
very same instructions and the only difference is how you 
interpret the data. In x86 they set both carry and overflow flags 
so you can decide which one you care about.


More information about the Digitalmars-d mailing list