In Ruby everything is an object. That's why I don't understand why we have the Math module. It seems to me that most (all?) of the functions in the Math module should have been methods on the numeric types like Integer, Float and so on.
E.g. instead of
Math.sqrt(5)
it would make more sense to have
5.sqrt
The same goes for sin
, cos
, tan
, log10
and so on.
Does anyone know why all these functions ended up in the Math module?