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

  1. Xref: sparky sci.math:11273 comp.lang.misc:3025 comp.lang.fortran:3519 comp.std.c:2607 comp.lang.c:13533
  2. Path: sparky!uunet!pmafire!news.dell.com!natinst.com!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc!news.service.uci.edu!beckman.com!dn66!a_rubin
  3. Newsgroups: sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c,comp.lang.c
  4. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  5. Message-ID: <a_rubin.716225408@dn66>
  6. From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
  7. Date: 11 Sep 92 15:30:08 GMT
  8. References: <92Sep1.205116edt.669@neuron.ai.toronto.edu>   
  9.  <1992Sep4.162938.29237@dscomsf.desy.de> <Bu2r42.5xr@mentor.cc.purdue.edu> 
  10.  <id.I12T.GP4@ferranti.com> <a_rubin.716152347@dn66> <1992Sep11.012559.17662@nntpd.lkg.dec.com>
  11. Nntp-Posting-Host: dn66.dse.beckman.com
  12. Lines: 26
  13.  
  14. In <1992Sep11.012559.17662@nntpd.lkg.dec.com> diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:
  15.  
  16. >In article <a_rubin.716152347@dn66> a_rubin@dsg4.dse.beckman.com (Arthur Rubin) writes:
  17. >>In <id.I12T.GP4@ferranti.com> peter@ferranti.com (peter da silva) writes:
  18. >>>In article <Bu2r42.5xr@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  19. >>>>[nxn -> 2n multiplication]
  20. >>>    int a, b;   long c;
  21. >>>    c = a * b;
  22. >>(peter commented further that this works on a PDP-11).
  23. >>Aside from there being no guarantee that "long" is longer than "int",
  24.  
  25. >>I don't think it is LEGAL for ANSI C to do this, although, I, also have seen
  26. >>it work in some C implementations.
  27.  
  28. >ANSI C leaves the result of overflow undefined.  But I think the standard
  29. >could pretty well define whatever it wanted without breaking higher laws.
  30.  
  31. I don't have a copy of the C standard, but,...
  32.  
  33. My interpretation (from reading K&R 2) would be that c = a * b should be
  34. equivalent to c = (int)(a * b).
  35. --
  36. Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
  37. 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
  38. My opinions are my own, and do not represent those of my employer.
  39. My interaction with our news system is unstable; please mail anything important.
  40.