From: Johann Hibschman Date: 2001-03-10T03:40:02+09:00 Subject: [ruby-talk:12348] Re: Math package Mathieu Bouchard writes: > why is it Math.sin(42.0) and not (42.0).sin ? Because sine isn't a method of numbers, and instead is a function in its own right? Not all functions with a single Float argument are methods of Float. The only functions which should be methods are those which are required to operate with the type, and sine isn't that fundamental. What about the gamma function? Or the Bessel J0 function? Error function? Erfc? Should those all be methods? There are just too many functions that you could define, so it makes sense to only make methods of the raw type-manipulation functions. Otherwise, we'd be left wondering if "sinh" is a method of Float or a member of the SpecialFunctions module. -- Johann Hibschman johann@physics.berkeley.edu