gcd/3—return the greatest common divisor of two numbers

The gcd/3 function returns the greatest common divisor of $NUMBER1 and $NUMBER2 in $RESULT.

$RESULT=gcd($NUMBER1,$NUMBER2)

gcd/3 arguments 

Argument

Mode

Type

Description

$NUMBER1

Input

INTEGER

Specifies the first integer value of the two integers for which a common divisor is to be returned

$NUMBER2

Input

INTEGER

Specifies the second integer value of the two integers for which a common divisor is to be returned

$RESULT

Output

INTEGER

The greatest common divisor of the two specified numbers

gcd/3 example

$GCD = gcd( $NUM1 , $NUM2 );
Was this page helpful? Yes No Submitting... Thank you

Comments