INTEGER FUNCTION GCD( P, Q ) <type>, INTENT( IN ) :: P, Q INTEGER FUNCTION LCM( P, Q ) <type>, INTENT( IN ) :: P, Q
Type-specific forms:
INTEGER FUNCTION GCDI( I1, I2 ) INTEGER(8) FUNCTION GCDL( L1, L2 ) INTEGER FUNCTION LCMI( I1, I2 ) INTEGER(8) FUNCTION LCML( L1, L2 ) INTEGER, INTENT( IN ) :: I1, I2 INTEGER(8), INTENT( IN ) :: L1, L2
int GCD( const int *p, const int *q ) ;
P,Q
.
For generic version, Fortran-90 declarations, and interface checking:
USE M3UTILIO
#include "iodecl3.h"
if called from C.
... USE M3UTILIO ... INTEGER P, Q, D INTEGER(8) L, M, N ... D = GCD( P, Q ) ! Now D is the gcd of P,Q ... N = GCD( L, M ) ! Now N is the gcd of L,M ... ... D = LCM( P, Q ) ! Now D is the lcm of P,Q ... N = LCM( L, M ) ! Now N is the lcm of L,M ...
... #include "iodecl3.h" ... int p, q, d ; ... d = GCD( &p, &q ) ; /* Now d is GCD of p,q */ ...
To: Models-3/EDSS I/O API: The Help Pages