home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp48 / 4239 next >
Encoding:
Text File  |  1992-08-12  |  1.0 KB  |  33 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!math.zko.dec.com!edp
  3. From: edp@math.zko.dec.com (Eric Postpischil)
  4. Subject: Re: Greatest Common Denominator
  5. Message-ID: <1992Aug12.133510.1314@nntpd.lkg.dec.com>
  6. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  7. Reply-To: edp@math.zko.dec.com (Eric Postpischil)
  8. Organization: Digital Equipment Corporation
  9. References:  <9208111504.AA04472@sicsoft.epfl.ch>
  10. Date: Wed, 12 Aug 1992 13:35:10 GMT
  11. Lines: 20
  12.  
  13. In article <9208111504.AA04472@sicsoft.epfl.ch>, grand@sicsoft.epfl.CH
  14. ((grand)) writes:
  15.  
  16. >Here is a little program which computes the greatest common denominator
  17. >of two numbers :
  18. >
  19. >\<< DO SWAP OVER MOD
  20. >    UNTIL DUP NOT END
  21. >    DROP ABS \>>
  22.  
  23. Here is a littler program:
  24.  
  25.     << WHILE DUP2 REPEAT MOD SWAP END DROP2 >>
  26.  
  27. (ABS at the end is optional.)
  28.  
  29.  
  30.                                 -- edp (Eric Postpischil)
  31.                                 "Always mount a scratch monkey."
  32.                                 edp@alien.enet.dec.com
  33.