INT_MIN and compiler diagnostic

D

David Thompson

(Ones' complement systems are rare these days, in part because
people are more interested in getting the wrong answer as fast as
possible than in getting the right answer. :) )

How so? I haven't heard of any case where 1sC gives a 'right' answer
that 2sC doesn't, for integers. (For floating point, the sign of zero
sometimes matters, and TTBOMK all common formats are S&M and do
preserve it; certainly the standardized one does.)

And it was my understanding that in earlier days a main advantage of
1sC was that it was faster for negate. It was only when MSI (and
higher) made carry-lookahead effectively free (in both cost and time)
that 2sC won out.
 
C

Chris Torek

How so? I haven't heard of any case where 1sC gives a 'right' answer
that 2sC doesn't, for integers.

The one usual "good case" here is when the bit pattern for -0 is
used as a trap representation, and "uninitialized" variables of
signed integral types are set to this bit pattern. But the remark
was meant more as a jab at the usual obsession with speed, often
to the exclusion of all else, including accuracy, hence the ":)".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top