Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Nanforum Toolkit v2.1 Reference Guide - <b>ft_gcd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FT_GCD()
 Calculate greatest common divisor of two numbers
------------------------------------------------------------------------------

 Syntax

      FT_GCD( <nNumber1>, <nNumber2> ) -> nGCD

 Arguments

     <nNumber1> is the first number to find the GCD of.

     <nNumber2> is the second number to find the GCD of.

 Returns

     The greatest common divisor of the 2 numbers, or 0 if either is 0.

 Description

   This function calculates the greatest common divisor between 2 numbers,
   i.e., the largest number that will divide into both numbers evenly.  It
   will return zero (0) if either number is zero.

 Examples

     ? FT_GCD(10,15)                  // Result: 5
     ? FT_GCD(108,54)                 // Result: 54
     ? FT_GCD(102,54)                 // Result: 6
     ? FT_GCD(111,17)                 // Result: 1

 Source: GCD.PRG

 Author: David Husnian

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson