Calculates the factorial n! / (n - k)!

@param {number} n
@param {number} k
@returns {number}
482961
function(n, k) {

    var p = 1;
    for (k = n - k; k < n; n--) {
      p *= n;
    }
    return p;
  }
1129816
function (m, n) {
      n %= 64
      if (n === 0) {
        return m
      } else if (n < 32) {
        return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n]
      } else {
        return [m[1] << (n - 32), 0]
      }
    }
199319
function(bcd) 
  {
    var n = 0;
    var m = 1;
    for(var i = 0; i<bcd.length; i+=1) {
        n += (bcd[bcd.length-1-i] & 0x0F) * m;
        n += ((bcd[bcd.length-1-i]>>4) & 0x0F) * m * 10;
        m *= 100;
    }
    return n;
  }
1209311
public function cdf(int $k): float
    {
        $a = $this->a;
        $b = $this->b;

        if ($k < $a) {
            return 0;
        }
        if ($k > $b) {
            return 1;
        }

        $n = $b - $a + 1;

        return ($k - $a + 1) / $n;
    }
169584
public static double approximateBinomialCoefficient(int n, int k) {
    final int m = max(k, n - k);
    long temp = 1;
    for(int i = n, j = 1; i > m; i--, j++) {
      temp = temp * i / j;
    }
    return temp;
  }
605299
function(n) {
    var num = abs(n), last = +num.toString().slice(-2);
    return n + getOrdinalSuffix(last);
  }
894523
def get_factors(n):
    

    def factor(n, i, combi, res):
        """[summary]
        helper function

        Arguments:
            n {[int]} -- [number]
            i {[int]} -- [to tested divisor]
            combi {[list]} -- [catch divisors]
            res {[list]} -- [all factors of the number n]
        
        Returns:
            [list] -- [res]
        """

        while i * i <= n:
            if n % i == 0:
                res += combi + [i, int(n/i)],
                factor(n/i, i, combi+[i], res)
            i += 1
        return res
    return factor(n, 2, [], [])
296477
function(k) {
            	if(!k)
            	    k = 0;
            	
            	return this.map(function(x, i, j) {
            	    return j - i >= k ? x : 0;
            	});
                }
61491
function mmult(A, B, n) {
  var C = new Array(n * n);

  for (var i = 0; i < n; i++) {
    for (var j = 0; j < n; j++) {
      C[i * n + j] = 0;
    }

    for (var k = 0; k < n; k++) {
      for (var _j = 0; _j < n; _j++) {
        C[i * n + _j] += A[i * n + k] * B[k * n + _j];
      }
    }
  }

  return C;
}
1207910
def k_bn(self, n, Re):
        
        bn = self.b_n(n)
        k = bn*Re**(-1./n)
        return k, bn
1219489
public static int nChooseK(int n, int k) {
    k = Math.min(k, n - k);
    if (k == 0) {
      return 1;
    }
    int accum = n;
    for (int i = 1; i < k; i++) {
      accum *= (n - i);
      accum /= i;
    }
    return accum / k;
  }
569946
function factorize(n, addFactor) {
    let remainder = 0;
    let i = 0;
    let multiplier = FOUND_PRIMES[i];

    //go through prime multipliers
    while (multiplier <= n) {
        do {
            remainder = n % multiplier;
            if (!remainder) {
                n /= multiplier;
                addFactor(multiplier);
            }
        } while (!remainder);
        multiplier = FOUND_PRIMES[++i];
    }
}
663477
function(n) {
            var sum = new Frac(0), l=this.coeffs.length;
            for(var i=0; i<l; i++) {
                var t = this.coeffs[i];
                if(!t.equals(0)) sum = sum.add(t.multiply(new Frac(Math.pow(n, i))));
            }
            return sum;
        }
1100849
function (m, n) {
      m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]
      n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]
      var o = [0, 0, 0, 0]
      o[3] += m[3] + n[3]
      o[2] += o[3] >>> 16
      o[3] &= 0xffff
      o[2] += m[2] + n[2]
      o[1] += o[2] >>> 16
      o[2] &= 0xffff
      o[1] += m[1] + n[1]
      o[0] += o[1] >>> 16
      o[1] &= 0xffff
      o[0] += m[0] + n[0]
      o[0] &= 0xffff
      return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]
    }
1212160
private double logL(int k, long n, double x) {
        if (x == 0.0) x = 0.01;
        if (x == 1.0) x = 0.99;
        return k * Math.log(x) + (n-k) * Math.log(1-x);
    }
147125
def binom(n, k):
    
    # http://blog.plover.com/math/choose.html
    if k > n:
        return 0
    if k == 0:
        return 1
    result = 1
    for denom in range(1, k + 1):
        result *= n
        result /= denom
        n -= 1
    return result
626485
function (n1, n2) {
            var isOk1 = _isNumber(n1),
                isOk2 = _isNumber(n2);
            
            if (isOk1 && isOk2) {
                // both are finite numbers
                return (n1 - n2);
            }
            else if (isOk1)
                return -1;
            else if (isOk2)
                return 1;
            else
                return 0;
        }