Factorial function

Christian Hemmingsen

GRD-2005-06-29.UTC:01:03:50.943925

1 Definition

Here we define the factorial funktion. First we define a pyk name: [factorial →^{pyk} “factorial”] then a TeX aspect

[x! →^{tex} “#1.!”]

and lastly the mathematical (logical) definition [x! →^{val} If(x ≈ 0, 1, x · x − 1!)]

2 Tests

We test for different values [1! ≈ 1]^{·} [2! ≈ 2]^{·} [3! ≈ 6]^{·} This next one is tricky since 24 is not defined as cardinal in pyk. H owever

there’s a way around that [4! ≈ 4 · 6]^{·}