function gcd(a, b) {
	// Treat non-numeric types as 0
	if (typeof a !== 'number' || isNaN(a)) a = 0;
	if (typeof b !== 'number' || isNaN(b)) b = 0;

	// Handle negative numbers properly
	// Never reaches base case w/o this
	a = Math.abs(a);
	b = Math.abs(b);

	// base case
	if (b <= 0.01) {
		return a;
	} else {
		return gcd(b, a % b);
	}
}
The function is used to find greatest common divisor (gcd) between two numbers.

@param {number} a - The first number to find gcd.
@param {number} b - The second number to find gcd.
@return {number} The greatest common divisor of the input numbers a and b.