~ubuntu-branches/debian/sid/genius/sid

« back to all changes in this revision

Viewing changes to lib/combinatorics/factorial.gel

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2014-04-07 15:43:04 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20140407154304-21r03zdnfc571kz0
Tags: 1.0.17-1
* Take over package from pkg-gnome
* New upstream release. Closes: #716731
* Bump standards version.
* Update Vcs fields to Git.
* Move to single-debian-patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
        (n!) * sum k=1 to n do ((-1)^k)/(k!)
12
12
)
13
13
 
14
 
SetHelp("Catalan","combinatorics","Get n'th catalan number");
 
14
SetHelp("Catalan","combinatorics","Get nth Catalan number");
15
15
function Catalan(n) = (
16
16
        if(IsMatrix(n)) then
17
17
                return ApplyOverMatrix(n,Catalan)
99
99
        MatrixSum(m)!/MatrixProduct(ApplyOverMatrix(m,`(x)[]=x!))
100
100
)
101
101
 
102
 
SetHelp("Pascal","combinatorics","Get the pascal's triangle as a matrix");
 
102
SetHelp("Pascal","combinatorics","Get the Pascal's triangle as a matrix");
103
103
function Pascal(i) = (
104
104
        if not IsNonNegativeInteger(i) then
105
105
                (error("Pascal: argument not a non-negative integer");bailout);