home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / sci / math / 11248 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  2.1 KB

  1. Xref: sparky sci.math:11248 comp.lang.misc:3016 comp.lang.fortran:3513 comp.std.c:2603 comp.lang.c:13488
  2. Newsgroups: sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c,comp.lang.c
  3. Path: sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!jit345.bad.jit.dec.com!diamond
  4. From: diamond@jit345.bad.jit.dec.com (Norman Diamond)
  5. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  6. Message-ID: <1992Sep11.012559.17662@nntpd.lkg.dec.com>
  7. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  8. Reply-To: diamond@jit.dec.com (Norman Diamond)
  9. Organization: Digital Equipment Corporation Japan , Tokyo
  10. References: <92Sep1.205116edt.669@neuron.ai.toronto.edu> <1992Sep4.162938.29237@dscomsf.desy.de> <Bu2r42.5xr@mentor.cc.purdue.edu> <id.I12T.GP4@ferranti.com> <a_rubin.716152347@dn66>
  11. Date: Fri, 11 Sep 1992 01:25:59 GMT
  12. Lines: 26
  13.  
  14. In article <a_rubin.716152347@dn66> a_rubin@dsg4.dse.beckman.com (Arthur Rubin) writes:
  15. >In <id.I12T.GP4@ferranti.com> peter@ferranti.com (peter da silva) writes:
  16. >>In article <Bu2r42.5xr@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  17. >>>[nxn -> 2n multiplication]
  18. >>    int a, b;   long c;
  19. >>    c = a * b;
  20. >(peter commented further that this works on a PDP-11).
  21. >Aside from there being no guarantee that "long" is longer than "int",
  22.  
  23. True, and even if it is, there is no reason that it has to work.  If anyone
  24. wants to pay me for it, I could write a C implementation for PDP-11(TM)
  25. non-computers in which the above doesn't work.
  26.  
  27. >I don't think it is LEGAL for ANSI C to do this, although, I, also have seen
  28. >it work in some C implementations.
  29.  
  30. ANSI C leaves the result of overflow undefined.  But I think the standard
  31. could pretty well define whatever it wanted without breaking higher laws.
  32.  
  33. ANSI conforming IMPLEMENTATIONS are allowed to do it because, when the
  34. standard doesn't define the result, the implementations can do whatever
  35. they want.
  36. --
  37. Norman Diamond       diamond@jit081.enet.dec.com
  38. If this were the company's opinion, I wouldn't be allowed to post it.
  39. "Yeah -- bad wiring.  That was probably it.  Very bad."
  40.