home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!mustang.mst6.lanl.gov!nntp-server.caltech.edu!draco.macsch.com!convex.is.macsch.com!dnl
- From: dnl@convex.is.macsch.com (David Lombard)
- Subject: Re: NH-- > NH
- Message-ID: <1993Jan9.010946.3172@draco.macsch.com>
- Sender: usenet@draco.macsch.com (Usenet Poster)
- Organization: MacNeal-Schwendler Corp.
- References: <1993Jan7.002651.10741@oracle.us.oracle.com> <C0JMw6.680@netnews.jhuapl.edu> <1993Jan8.210335.28340@sharebase.com>
- Date: Sat, 9 Jan 93 01:09:46 GMT
- Lines: 35
-
- In article <1993Jan8.210335.28340@sharebase.com> keith@torme.sharebase.com (Keith Chambless) writes:
- >In article <C0JMw6.680@netnews.jhuapl.edu> bandy@netnews.jhuapl.edu (Mike Bandy) writes:
- >>
- >>So what you're saying is that NH > NH. I don't believe it. Your
- >>compiler (or your logic) has some serious problems.
- >
- >
- >Weird. Mine (Solbourne w/OS/MP 4.0) works the same:
- >
- > if (nh-- > nh)
- > printf("nh-- > nh = true\n");
- >
- >prints true. I don't understand.
-
-
- First, the original author of "nh-- > nh" should be shot (unless of course
- it's meant as a jest, a trick question, or an extract from some obfuscated
- programming contest:-)
-
- As far as why it _is_ working, the operation nh-- is executed _before_ the
- second reference to nh is used. A way to look at the comparison (ingoring
- the side effect) is:
-
- nh > (nh-1)
-
- Never confuse "Gee it works" with "that's the result you should expect."
-
- Regards,
- DNL
-
- MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;
-
- David N. Lombard The first thing we do, The MacNeal-Schwendler Corp
- dnl@macsch.com Let's kill all the lawyers. 815 Colorado Blvd
- (213) 259-4911 II Henry VI, IV.ii Los Angeles, CA 90041
-