home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / basic / baswiz18.zip / BW$BAS.ZIP / GCDL.BAS < prev    next >
BASIC Source File  |  1992-08-29  |  766b  |  21 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1992  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      The BASIC Wizard's Library                      |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DEFLNG A-Z
  10.  
  11. FUNCTION GCDL& (Nr1 AS LONG, Nr2 AS LONG)
  12.    N1 = Nr1
  13.    N2 = Nr2
  14.    DO
  15.       Remainder = N1 MOD N2
  16.       N1 = N2
  17.       N2 = Remainder
  18.    LOOP UNTIL Remainder = 0&
  19.    GCDL& = N1
  20. END FUNCTION
  21.