| |
|
|
p.specht
| The n-over-k function (Binomialkoeffizienten the Pascal´schen Dreiecks) lead rasch To gigant numbers, The The double-precision floats of XProfan überfordern. here therefore my attempt, The Zahlendarstellung with separated Exponenten To to charge: Float-numbers over 10^154 threatening namely in the next step überzulaufen, and go here then aufgesplittet. The Number of therefore additional compel Kommaverschiebungen becomes then additional angeschrieben. in the everywhere known Pascalschen Dreieck is n The 'N-th basement-Ebene' and k the place in the jeweiligen row, of left ex 1 counted. demonstration without Gewähr!
Window Title "BinCoeff(n over k) = n!/((n-k)!*k!)"
var f!=10^154'1.3407807929942596324916056014016*10^154
declare n!,k!,p!,q!,i&:font 2: rpt:
set("decimals",0):cls rgb(0,240,255)
print " n = ";:input n!: loop:
locate 2,1:print " k = ";:input k!:case k!=0:goto "rpt"
if k!>n!:beep:goto "rpt":endif :case 2*k!>n!:k!=n!-k!
i&=int(k!+0.00000000000005):p!=1:q!=0
whileloop i&,1,-1:p!=p!*(n!+1-&Loop):p!=p!/&Loop
if p!>f!:p!=p!/f!:q!=q!+1:endif
endwhile
print "= BinCoeff(";n!;" over ";k!;") = "
case (p!>10000000000) or (q!>0): set("decimals",17)
print p! :case q!:print " *10^";154*q!
goto "loop"
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/14/21 ▲ |
|
|
|