Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
* Evaluate binomial coefficients - 29/09/2015
|
||||
BINOMIAL CSECT
|
||||
USING BINOMIAL,R15 set base register
|
||||
SR R4,R4 clear for mult and div
|
||||
LA R5,1 r=1
|
||||
LA R7,1 i=1
|
||||
L R8,N m=n
|
||||
LOOP LR R4,R7 do while i<=k
|
||||
C R4,K i<=k
|
||||
BH LOOPEND if not then exit while
|
||||
MR R4,R8 r*m
|
||||
DR R4,R7 r=r*m/i
|
||||
LA R7,1(R7) i=i+1
|
||||
BCTR R8,0 m=m-1
|
||||
B LOOP loop while
|
||||
LOOPEND XDECO R5,PG edit r
|
||||
XPRNT PG,12 print r
|
||||
XR R15,R15 set return code
|
||||
BR R14 return to caller
|
||||
N DC F'10' <== input value
|
||||
K DC F'4' <== input value
|
||||
PG DS CL12 buffer
|
||||
YREGS
|
||||
END BINOMIAL
|
||||
Loading…
Add table
Add a link
Reference in a new issue