isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Fix binomial coefficient computation (.C A B) for A < B ≤ 2·A #231

Closed andersk closed 7 years ago

andersk commented 7 years ago

The old code gave an incorrect result for A < B ≤ 2·A and an error for B < 0. This fixes .c A B to be defined for all integers A, B consistently with M.J. Kronenburg, “The Binomial Coefficient for Negative Arguments” (2011), https://arxiv.org/abs/1105.3689.