From: Tomo Kazahaya Date: 2011-08-03T09:37:55+09:00 Subject: Re: Argument error in ludcmp when using Newton module Hi Bill, You got the error because your Function#values returned a Float instead of a BigDecimal. While BigDecimal#div can take up to two arguments, Float#div takes only one. Here is a modified version of your code: http://pastebin.com/C9ratXer Hope this helps. Tomo On Fri, Jul 29, 2011 at 8:17 PM, wrote: > Hi, > > I am trying to use bigdecimal/newton for an implementation of XIRR.  A > copy of the code I am trying to run can be found here: > http://pastebin.com/VVMB4bRs > > When I run the code (Ruby 1.9.2 on Mac OS X 10.6), I get the following error: > > /opt/local/lib/ruby1.9/1.9.1/bigdecimal/ludcmp.rb:84:in `div': wrong > number of arguments(2 for 1) (ArgumentError) >        from /opt/local/lib/ruby1.9/1.9.1/bigdecimal/ludcmp.rb:84:in `block in lusolve' >        from /opt/local/lib/ruby1.9/1.9.1/bigdecimal/ludcmp.rb:78:in `downto' >        from /opt/local/lib/ruby1.9/1.9.1/bigdecimal/ludcmp.rb:78:in `lusolve' >        from /opt/local/lib/ruby1.9/1.9.1/bigdecimal/newton.rb:60:in `nlsolve' >        from gistfile1.rb:52:in `
' > > Is this because of an error in my program, or something in the > BigDecimal library? > > Any assistance in debugging this would be greatly appreciated. > > Thanks, > Bill > >