From bug-request at octave dot org Thu Apr 6 15:38:44 2006 Subject: bincoeff gives wrong results on bad input From: "John W. Eaton" To: martin Cc: bug at octave dot org, martin@old.homeip.net Date: Thu, 6 Apr 2006 16:38:39 -0400 On 22-Mar-2006, martin wrote: | To: bug at octave dot org | Cc: martin at old dot homeip dot net | Subject: bincoeff gives wrong results on bad input | | Bug report for Octave 2.1.72 configured for i486-pc-linux-gnu | | Description: | ----------- | | Bincoeff succeeds silently on buggy input. | | Another note, nchoosek should perhaps work too, for matlab | compatibility. | | Repeat-By: | --------- | | octave:10> bincoeff(4, 55) | ans = 0 # that is fine I guess | octave:8> bincoeff(-4, 4) | ans = 35 # I don't think it makes sense to give a result here? | octave:7> bincoeff(-4, -1) | ans = NaN # not sure about this one So what should the results be? I don't know what the correct thing to do is here, so someone who knows will have to provide a patch. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------