From: Phrogz Date: 2007-01-09T15:35:07+09:00 Subject: Re: Why is there a seperate Math class? Daniel Finnie wrote: > Why does everything have to be Math.(num)? Isn't num.func more > object oriented-ish? In addition to the answers by others, what would you do for those math functions whose arity isn't 1? Math.methods(false).select{ |n| Math.method(n).arity != 1 } #=> ["hypot", "atan2", "ldexp"] All three take two arguments. While 3.hypot(4) *might* make sense--given one leg of a right triangle, how long is the hypotenuse to a given other leg--30.atan2( 40 ) makes little sense to me. A few exceptions might not make a good arguments against 19 possibly plausible cases. In my opinion, however, once you have to break the rule it makes sense to look for a new way to handle all the cases similarly. And, personally, I agree with Matz - the trigonometric functions simply look more correct (to me) as functions that take an argument, not methods invoked upon a number. That's purely a matter of taste, though.