Sha256: 3316184fb5c1e430bb416fa717abd9d588e708cba857025776529814c726c8e8
Contents?: true
Size: 214 Bytes
Versions: 5
Compression:
Stored size: 214 Bytes
Contents
# coding: utf-8 class Integer def stirling(m) n = self return 1 if (n.zero? and m.zero?) or m == n return 0 if m > n or m.zero? or n.zero? (n-1).stirling(m-1) - (n-1)*(n-1).stirling(m) end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
numb-0.186.0 | lib/numb/stirling.rb |
numb-0.185.0 | lib/numb/stirling.rb |
numb-0.184.0 | lib/numb/stirling.rb |
numb-0.181.0 | lib/numb/stirling.rb |
numb-0.170.0 | lib/numb/stirling.rb |