Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
@%=&1010
|
||||
|
||||
PRINT "Binomial (5,3) = "; FNbinomial(5, 3)
|
||||
PRINT "Binomial (100,2) = "; FNbinomial(100, 2)
|
||||
PRINT "Binomial (33,17) = "; FNbinomial(33, 17)
|
||||
END
|
||||
|
||||
DEF FNbinomial(N%, K%)
|
||||
LOCAL R%, D%
|
||||
R% = 1 : D% = N% - K%
|
||||
IF D% > K% THEN K% = D% : D% = N% - K%
|
||||
WHILE N% > K%
|
||||
R% *= N%
|
||||
N% -= 1
|
||||
WHILE D% > 1 AND (R% MOD D%) = 0
|
||||
R% /= D%
|
||||
D% -= 1
|
||||
ENDWHILE
|
||||
ENDWHILE
|
||||
= R%
|
||||
Loading…
Add table
Add a link
Reference in a new issue