home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / baswiz19.zip / BW$BAS.ZIP / GCDL.BAS < prev    next >
BASIC Source File  |  1993-01-29  |  766b  |  21 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1993  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.