phaser/src/math/Bernstein.js
2018-01-09 21:43:56 +00:00

19 lines
359 B
JavaScript

var Factorial = require('./Factorial');
/**
* [description]
*
* @function Phaser.Math.Bernstein
* @since 3.0.0
*
* @param {number} n - [description]
* @param {number} i - [description]
*
* @return {number} [description]
*/
var Bernstein = function (n, i)
{
return Factorial(n) / Factorial(i) / Factorial(n - i);
};
module.exports = Bernstein;