Evaluate binomial coefficients: Difference between revisions
Content added Content deleted
m (→{{header|Lua}}: handle overflow by switching to double approximate) |
m (→{{header|Lua}}: not save some out of normal(?) inputs bound case) |
||
Line 1,189: | Line 1,189: | ||
local ans = self[hash] |
local ans = self[hash] |
||
if not ans then |
if not ans then |
||
if n< |
if n<0 or k>n then |
||
return 0 -- not save |
|||
⚫ | |||
ans = 1 |
ans = 1 |
||
⚫ | |||
ans = 0 |
|||
else |
else |
||
if 2*k > n then |
if 2*k > n then |