Added gcd() function

Added a function to calculate the greatest common divisor using
Euclid's algorithm. As this really only makes sense for floating
point types, it only works on those.