gcf

num gcf(num a, num b)

num - any numeric type (int or fixed)

Description

Returns the greatest common factor of two numbers.

The result will be negative if one or both arguments are negative.

Examples

gcf(18, 24) -> 6
gcf(-18, 24) -> -6
gcf(18, -24) -> -6
gcf(-18, -24) -> -6
gcf(18.0, 24.0) -> 6.0
gcf(-18.0, 24.0) -> -6.0
gcf(18.0, -24.0) -> -6.0
gcf(-18.0, -24.0) -> -6.0