Re: C Questions



Richard Heathfield wrote:

pete said:

Richard Heathfield wrote:

! yields 0 if its (numeric!) operand is non-zero, and 1 otherwise.

! yields 0 if its scalar operand does not compare equal to zero,
and 1 otherwise.

Oh yes, you can do !p, can't you?
I see that as being rather silly, but
you're quite right that it's legal. I'm not sure that I see the
distinction between "is non-zero"
and "does not compare equal to zero". I
consider them to be equivalent statements.

A type conversion is required for a pointer
to be compared to zero,
and that's the difference between "compares" and "is".


Some more musings concerning the difference between
"compares" and "is":

(0) compares equal to (0u)
(-1) compares greater than (0u)
(0) compares greater than (-1)

Is (-1) greater than or less than (0u)?

--
pete
.



Relevant Pages

  • Re: C Questions
    ... pete said: ... yields 0 if its scalar operand does not compare equal to zero, ...
    (comp.lang.c)
  • Re: Why Einstein geometrized away Newtons "force of gravity"
    ... seeing he gained 10 lbs) the gravitational force is not zero. ... But this is not because "gravitational force is not zero", it is due to Pete's WEIGHT being not zero. ... This is correct ONLY in coordinates fixed to the surface of the earth. ... No surprise -- Pete is at rest in these coordinates, so in pmb's worldview, one must INVENT a "gravitational force" to cancel F_s; there's no requirement that such inventions must behave like physical quantities behave. ...
    (sci.physics.relativity)
  • Re: C Questions
    ... yields 0 if its scalar operand does not compare equal to zero, ...
    (comp.lang.c)
  • Re: Why Einstein geometrized away Newtons "force of gravity"
    ... setting proper mass to zero). ... and its should represent covariant components, ... and Pete standing on his bathroom scale, ... bathroom scale, relative to Earth coordinates. ...
    (sci.physics.relativity)
  • Re: Assessing Federer and Sampras
    ... Pete ever was. ... But he was a zero in the media and a zero ... But in absolute terms Agassi is pretty dull you have to admit. ... I don't like Agassi's game or his fake personality, ...
    (rec.sport.tennis)