static/js/ari.js
/**
 * Calculate the factorial divided by another factorial iteratively.
 * @function factorial
 * @param {number} n - the input integer
 * @param (number) m - the input integer, default to 1
 * @return {number} the factorial quotient of 2 integers
 */
Calculate the factorial divided by another factorial iteratively.
@function factorial
@param {number} n - the input integer
@param (number) m - the input integer, default to 1
@return {number} the factorial quotient of 2 integers
Calculate the factorial divided by another factorial iteratively . @function factorial @param { number } n - the input integer @param ( number ) m - the input integer default to 1 @return { number } the factorial quotient of 2 integers
function factorial(n, m=1) {
  if (!Number.isInteger(n) || (m != undefined && !Number.isInteger(m))) {
    return 0;
  }
  let res = m;
  for (let i = m + 1; i <= n; i++) {
    res *= i;
  }
  return res;
}
function factorial ( n , m = 1 ) { if ( ! Number . isInteger ( n ) || ( m != undefined && ! Number . isInteger ( m ) ) ) { return 0 ; } let res = m ; for ( let i = m + 1 ; i <= n ; i ++ ) { res *= i ; } return res ; }
Calculate the factorial divided by another factorial iteratively.
Calculate the factorial divided by another factorial iteratively .