From: Vincent Fourmond Date: 2007-01-23T08:18:43+09:00 Subject: Re: Minor Change Proposal for Class 'Numeric' Phrogz wrote: > Wolfgang N�dasi-Donner wrote: >> class Numeric >> def sign >> self<0?-1:self>0?1:0 >> end >> end >> >> ...but it should be much faster if be defined in the original class. > > a) Why do you need it to be so fast? Two comparisons seems pretty > lightweight to me! You forget function lookup: there is three function lookup for this code. Hardcoded in C is way faster (with only one function lookup). Vince -- Vincent Fourmond, PhD student http://vincent.fourmond.neuf.fr/