Sha256: 8f2c53e38382142602e3877be54292629e75ae5e43d385f58b620dbe65f495d6

Contents?: true

Size: 134 Bytes

Versions: 1

Compression:

Stored size: 134 Bytes

Contents

class Fixnum
  def binomial_coefficient bottom
    (self - bottom + 1 .. self).inject(1, &:*) / (2 .. bottom).inject(1, &:*)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rstat-0.1.0 lib/rstat/core_ext/fixnum/binomial_coefficient.rb