IRIX 3.2 C compiler bug (Mark Gets Pie in the Face)
Mark VandeWettering
markv at gauss.Princeton.EDU
Tue Feb 6 07:03:01 AEST 1990
In article <12999 at cgl.ucsf.EDU> conrad at cgl.ucsf.edu (Conrad Huang) writes:
>Say what!? In K&R, Appendix A, page 189, Section 7.6,
>
> "The operators < (less than), > (greater than), <= (less than or
> equal to) and >= (greater than or equal to) all yield 0 if the
> spricified relation is false, and 1 if it is true"
Gadzooks. I went back and looked this up, and you were right. I had
always operated on the assumption that the only thing you knew about
TRUE was that it wasn't zero. Oh well, pie in my face number one.
>In the first place, the program ought to print 0, since 1.0 == 2.0 is *false*.
>In the second place, even if they were equal, it should print 1.000000.
Actually, if we wanna get really technical about it, this program shouldn't
work at all, because you passed a double to the printf, when in fact it
wants a float argument. This usually works out, but I have had it fail
on various machines (particularly mips based ones) in very odd ways, so
one should be careful.
But ignoring that, you are of course correct. It should return 0.0000
and doesn't. Pie in the face #2 for me.
That's what I get for posting late at night.
Mark
More information about the Comp.sys.sgi
mailing list