home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky sci.math:11273 comp.lang.misc:3025 comp.lang.fortran:3519 comp.std.c:2607 comp.lang.c:13533
- 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
- Newsgroups: sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c,comp.lang.c
- Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
- Message-ID: <a_rubin.716225408@dn66>
- From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
- Date: 11 Sep 92 15:30:08 GMT
- 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> <1992Sep11.012559.17662@nntpd.lkg.dec.com>
- Nntp-Posting-Host: dn66.dse.beckman.com
- Lines: 26
-
- In <1992Sep11.012559.17662@nntpd.lkg.dec.com> diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:
-
- >In article <a_rubin.716152347@dn66> a_rubin@dsg4.dse.beckman.com (Arthur Rubin) writes:
- >>In <id.I12T.GP4@ferranti.com> peter@ferranti.com (peter da silva) writes:
- >>>In article <Bu2r42.5xr@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
- >>>>[nxn -> 2n multiplication]
- >>> int a, b; long c;
- >>> c = a * b;
- >>(peter commented further that this works on a PDP-11).
- >>Aside from there being no guarantee that "long" is longer than "int",
-
- >>I don't think it is LEGAL for ANSI C to do this, although, I, also have seen
- >>it work in some C implementations.
-
- >ANSI C leaves the result of overflow undefined. But I think the standard
- >could pretty well define whatever it wanted without breaking higher laws.
-
- I don't have a copy of the C standard, but,...
-
- My interpretation (from reading K&R 2) would be that c = a * b should be
- equivalent to c = (int)(a * b).
- --
- Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
- 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
- My opinions are my own, and do not represent those of my employer.
- My interaction with our news system is unstable; please mail anything important.
-