Computes the greatest common divisor (gcd).
a
b
0
NaN
integer
greatest common divisor
var v = gcd( 48, 18 ); // returns 6
var v = gcd( 3.14, 18 ); // returns NaN
var v = gcd( NaN, 18 ); // returns NaN
Computes the greatest common divisor (gcd).
Notes
a
andb
are0
, the function returns0
.a
andb
must have integer values; otherwise, the function returnsNaN
.