C
CBFalconer
Joe said:Of course but these machines imaginary aren't they?
To the same extent that -1 is.
Joe said:Of course but these machines imaginary aren't they?
osmium said:Some of your alleged humour is on a par with your food. If I had
not responded an innocent passerby who didn't try to parse your
response, as I did, could be misled badly.
This is a very tough room. Let me try again. The question..CBFalconer said:To the same extent that -1 is.
Of course but these machines imaginary aren't they?
Joe said:This is a very tough room. Let me try again. The question..
"what is meaned by " i = ~0 "..." might translate to..
int i = ~0;
..What goes on here?
The 0 of course in an integer value with all bits 0. The prefix tilde
performs a binary complement of the value, in this case to all bits 1.
The value of 'all bits 1' depends on how you look at it.
Two's complement suggests -1.
Yes.
One's complement suggests -0.
Signed Magnitude maybe minus INT_MAX?
Joe said:Of course but these machines imaginary aren't they?
Eric Sosman said:Or to put it another way: A friend of mine likes to say
that computing is a fashion-driven industry. Fashions come,
and fashions go, and fashions come again. You can write your
program for this season's hem lines and color schemes, or you
can attempt something a little less transitory. There are,
after all, some distinct infelicities in two's complement:
the fact that abs(n) cannot be implemented reliably stands
out as an ugliness that neither of the alternatives suffer
from, and tomorrow's system couturier may reject that ugliness.
Trap representations for integers are Out today, but in the
face of viral onslaught might not tomorrow's machine revive
the old practice of explicitly-typed data?
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.