Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change factorial function in combination #23

Closed
bblodfon opened this issue Dec 12, 2020 · 1 comment
Closed

Change factorial function in combination #23

bblodfon opened this issue Dec 12, 2020 · 1 comment
Assignees

Comments

@bblodfon
Copy link

Hi @dpaukov ,

I've been using this version of the library and an issue arose, which I believe is minimal work to correct, so here it is:

I use the getNumberOfGeneratedObjects function which uses the simple factorial and not the one with the BigDecimal type, so when in my application I happened to use in the combination(n,k), n=21 and k=0 respectively, it return zero for the denominator. (factorial(21) > max Long).

If instead the Util.combination(n,k) function was using the BigDecimal factorial, and only after the calculation it converted to long type, that would an easy and satisfiable fix for me (^-^)

@dpaukov dpaukov self-assigned this Dec 13, 2020
@dpaukov
Copy link
Owner

dpaukov commented Dec 13, 2020

The change has been released in version 2.3 today.

@dpaukov dpaukov closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants