English
Source / code snippets

n-over-k-function (Pascalsches Dreieck)

 

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 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
04/14/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

655 Views

Untitledvor 0 min.
N.Art07/23/21
Glubbfan06/19/21
Uwe ''Pascal'' Niemeier06/13/21
Walter04/25/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie