using !

Don Rober rober at jetsun.weitek.COM
Sat Dec 22 08:38:26 AEST 1990


In article <009417DC.37A9DCA0 at cemmva.cem.msu.edu> heroux at cemmva.cem.msu.edu (Brett Heroux) writes:
>
>Is !(a > b) portable? slower or faster than  a <= b?

I am leaving for vacation, so I won't consider the integer case. :>)

If you are using IEEE floating point numbers, the two cases aren't
even equivalent. If one or both have a vane of NaN, both relations are
false. The negation of false in the first example will then produce true.

Just another interesting thing to watch out for in IEEE floating point.

-- 
----------------------------------------------------------------------------
Don Rober				       UUCP: {pyramid}!weitek!rober



More information about the Comp.lang.c mailing list