From: Christopher Dicely Date: 2008-02-10T04:53:44+09:00 Subject: Re: Internal Rate of Return (#156) On Feb 9, 2008 9:44 AM, wrote: > On Feb 9, 2:08 pm, ThoML wrote: > > How should the following values be handeld? According to some info I > > found somewhere, 0..2 should be considered illegal, which doesn't > > quite match my computations though. > > > > [-1.0, 1.0] > > 0 > > > [-1000.0, 999.99] > > -0.00001 > > > [-1000.0, 999.0] > > -0.001 > > > [0.0] > > does not find a solution (mine returns nil) Its a meaningless input anyway, but wouldn't any rate be a solution? Since you are looking for the discount rate at which the NPV is 0, if the only flow is an initial investment of 0, any discount rate will produce an NPV of 0. (Mine produces 0 for this case.) > > > [] > > division by zero. (nil after I add a begin..rescue..end :-) I would think this would be equivalent to the preceding case and, likewise, any discount rate you try would be a valid solution. (And, again, mine produces 0 here.)