home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.std.c:2639 comp.lang.c:13715
- Path: sparky!uunet!gatech!concert!duke!dsb
- From: dsb@duke.cs.duke.edu (D. Scott Bigham)
- Newsgroups: comp.std.c,comp.lang.c
- Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
- Message-ID: <716616917@romeo.cs.duke.edu>
- Date: 16 Sep 92 04:15:18 GMT
- References: <a_rubin.716225408@dn66 <1992Sep12.16491 <1992Sep16.014635.27449@nntpd.lkg.dec.com>
- Followup-To: comp.std.c
- Organization: n. Arrangement in an orderly or logical fashion. See "miracle".
- Lines: 33
-
- From the Holy Book of <1992Sep16.014635.27449@nntpd.lkg.dec.com>
- as spake by diamond@jit.dec.com (Norman Diamond) :
- >Yeah, and Mr. Bigham tried to trick me into posting to comp.lang.c (without
- >warning), so I've added comp.lang.c back in for Mr. Bigham.
-
- Trick? My dear sir, that's where I _found_ the article I was replying
- to! Follow-ups re-redirected for your peace of mind. :)
-
- >OK, I can find in ANSI 3.2.1.5, page 36 lines 17 to 18, "and yield result
- >types in a similar way. The purpose is to yield a common type, which is
- >also the type of the result."
-
- However (I take you to mean), if the product overflows the type of the
- result, we experience the dreaded Undefined Behavior and the compiler is
- free to do anything it wants, including changing the type of the result
- to accommodate the value of the product. Okay, fair enough.
-
- >Sounds like it agrees with the standard. Sometimes the result [of cast
- >to int] is defined by the standard, the rest of the time the result is
- >defined by the implementation, and the result is never undefined.
-
- A fine distinction, and one I'm not certain I understand. Is the
- implementation required, for instance, to inform the programmer how it
- will behave in an "implementation-defined" situation? Is the
- implementation free to define that overflow in expressions causes your
- computer to turn into an alligator?
-
- -sbigham
- --
- Scott Bigham | The opinions expressed above are
- dsb@romeo.cs.duke.edu | (c) 1992 Hacker Ltd. and cannot be
- bigham@hercules.acpub.duke.edu | copied or distributed without a
- (but not for long) | Darn Good Reason(tm).
-