GCD()

Fortran version:

    INTEGER FUNCTION  GCD( P, Q )
        INTEGER   P, Q

C version:

    int GCD( const int *p, const int *q ) ;

Summary:

GCD() returns the greatest common divisor of integers P,Q

Preconditions:

#include "iodecl3.h" if called from C.

Fortran Usage:

    ...
    ...
    INTEGER   GCD
    INTEGER   P, Q, D
    ...
    D = GCD( P, Q )   !  Now D is the gcd of P,Q
    ...

C Usage:

    ...
    #include "iodecl3.h"                          
    ...
    int  p, q, d ;
    ...
    d = GCD( &p, &q ) ; /*  Now d is GCD of p,q */
    ...


Previous: FIND1, FIND2, FIND3, FIND4

Next: GCTP

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages