You are a stupid programmer, you can't have that
Paul Backus
snarwin at gmail.com
Mon Aug 9 20:18:26 UTC 2021
On Monday, 9 August 2021 at 19:23:14 UTC, H. S. Teoh wrote:
> As Knuth once said:
>
> People who are more than casually interested in computers
> should
> have at least some idea of what the underlying hardware is
> like.
> Otherwise the programs they write will be pretty weird.
> -- D. Knuth
>
> That includes knowing the ugly realities of 2's complement
> arithmetic.
The way I remember it, 2's complement notation is a method of
encoding signed integers as unsigned integers such that a CPU can
use the same instructions and circuits for both signed and
unsigned arithmetic.
So, from the hardware's point of view, unsigned arithmetic is the
pure, simple version, and signed arithmetic is the ugly, complex
version. :)
More information about the Digitalmars-d
mailing list