[Rd] choose incorrect for fractional and some negative integer values (PR#10766)

Ben Bolker bolker at ufl.edu
Sun Feb 17 03:12:21 CET 2008


 <Jerry.Lewis <at> biogenidec.com> writes:

> 
> Full_Name: Jerry W. Lewis
> Version: 2.6.2
> OS: Windows XP Professional
> Submission from: (NULL) (198.180.131.16)
> 
> choose() returns incorrect values for all fractional arguments, regardless of
> sign.  It returns 0 when both arguments are negative integers, which is not
> always correct (as in some formulations of the negative hypergeometric).
> 
> Examples (correct answers from Maple's binomial function):
> 
> choose( 4.75,2.75)  # should be 8.90625

  [snip]

  The help page does say that k is supposed to be an integer -- so
I don't think this is a bug.
  Should the function either (a) test for k == (or close to ==) an integer
or (b) be rewritten to work more generally?

  Ben



More information about the R-devel mailing list