home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.arch:9298 sci.math:11147 comp.lang.misc:2976 comp.lang.fortran:3483 comp.edu:1585
- Newsgroups: comp.arch,sci.math,comp.lang.misc,comp.lang.fortran,comp.edu
- Path: sparky!uunet!usc!rpi!scott.skidmore.edu!psinntp!psinntp!ficc!peter
- From: peter@ferranti.com (peter da silva)
- Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
- Message-ID: <id.I12T.GP4@ferranti.com>
- Organization: Xenix Support, FICC
- References: <92Sep1.205116edt.669@neuron.ai.toronto.edu> <1992Sep4.162938.29237@dscomsf.desy.de> <Bu2r42.5xr@mentor.cc.purdue.edu>
- Date: Tue, 8 Sep 1992 18:23:17 GMT
- Lines: 40
-
- In article <Bu2r42.5xr@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
- > There has been discussion on some of these groups about the lack of nxn -> 2n
- > multiplication, where n is the integer word size;
- > But I know of no HLL which allows writing this.
-
- C:
- int a, b;
- long c;
-
- c = a * b;
-
- Fortran:
- INTEGER*2 A, B
- INTEGER*4 C
-
- C = A * B
-
- I've used both of these on the PDP-11, and gotten the expected 2x2->4 multiply
- in the generated code. Forth includes the referenced operation directly.
-
- Blame the people who did the VAX C compiler if you can't do it on your RISC
- of the month. LONG on the VAX-11 should have been 64 bits. It's not a language
- shortcoming.
-
- > There is also the comparable division operation.
-
- int a, b, d;
- long c;
-
- a = c / d;
- b = c % d;
-
- > The use of these features is portable.
-
- Pretty much.
- --
- Peter da Silva `-_-'
- Ferranti Intl. Ctls. Corp. 'U`
- Sugar Land, TX 77487-5012
- +1 713 274 5180 Har du kramat din varg idag?
-