Re: bitwise operator !!



CBFalconer wrote, On 09/12/08 01:22:
Flash Gordon wrote:
CBFalconer wrote:
blargg wrote:

... snip ...
Sorry if I'm repeating myself from another message (or forgot the
reason given), but couldn't a compiler on a two's complement
platform do the same thing, define INT_MIN to be -INT_MAX? For
example, if int is 16 bits on such a machine, then INT_MAX would
be 32767 and INT_MIN would be -32767. Then you're guaranteed that
every valid value of an int can be negated properly.
And then, on such a machine, you have an illegal bit pattern for an
integer left over. No other languages or programs on that machine
understand this. What are you going to do with it?
I think the standards committee disagreed with you since they
explicitly allow what you are denigrating. In any case, how do you
know the no other languages would understand it? The most likely
time it would occur is on a processor which would/could trap on it
(or possibly do a hard limit on arithmetic at +/-32767. There are
even good reasons for this behaviour to be desired in signal
processing.

I'm not disagreeing with you. I AM disagreeing with the
advisability of implementing blarggs suggestion.

Blarg is suggesting an implementation could have INT_MIN = -INT_MAX with
2s complement. I am suggesting that not only is this allowed but that
there are actually very good reasons why this might be done. So I don't
see how you can be suggesting that implementing Blargg's suggestion is
inadvisable without disagreeing with my claim that there are good
reasons to implement what Blarrg is suggesting.

To be clear, I think there are *very* good reasons to implement what
Blarrg is suggesting could be implemented, so I believe that any banket
suggestion that doing so is inadvisable is just plain wrong.
--
Flash Gordon
If spamming me sent it to smap@xxxxxxxxxxxxxxxxx
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
.



Relevant Pages

  • Re: Why does no one post here? Anyone have patterns to share
    ... a reply but you fail to acknowledge the reply to your two questions. ... common courtesy to my reply to you and that's one of the reasons why ... for suggesting a site to get your Santa pattern, ... of fact but totally understandable comming from a newbie here, ...
    (rec.crafts.carving)
  • Re: Why does no one post here? Anyone have patterns to share
    ... You commented the next day on someone elses reply that was ... common courtesy to my reply to you and that's one of the reasons why ... for suggesting a site to get your Santa pattern, ... of fact but totally understandable comming from a newbie here, ...
    (rec.crafts.carving)
  • Re: Why does no one post here? Anyone have patterns to share
    ... You commented the next day on someone elses reply that ... reasons why I don't even bother to read ... acknowledgement for suggesting a site to get your Santa pattern, ... ignorant of fact but totally understandable comming from a newbie ...
    (rec.crafts.carving)
  • Re: Hmm - heres a topic to spark off a nice social commentary thread..
    ... insulting, for reasons that just are and cannot be explained? ... I think part of the problem is that the terms you've been suggesting are ... If *you* know of a word that carries the correct meanings of ...
    (rec.arts.sf.composition)
  • Re: Maintance of c++ code
    ... piotr5@xxxxxxxxxxxxxxxxx (Piotr Sawuk) wrote: ... I too use comments to document the reasons why I made one choice ... int get ... Bar* b = new Bar; ...
    (comp.object)