From: gotoken@... (GOTO Kentaro) Date: 2001-03-10T02:22:17+09:00 Subject: [ruby-talk:12339] Re: Math package In message "[ruby-talk:12329] Math package" on 01/03/10, Mathieu Bouchard writes: >why is it Math.sin(42.0) and not (42.0).sin ? Though Math::sin is not bad, I would like Numeric# as dispatch often (too). Matz, how about this specification for the built-in functions taking just one parameter: module Math alias __sin__ sin def sin(obj) if obj.is_a? Numeric __sin__(obj) else obj.sin end end end This allows us to write as Math::sin(numarray). By the way, I think Math function should be also defined in Math::Libm. -- Gotoken