home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / arch / 9298 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.7 KB

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