summaryrefslogtreecommitdiff
path: root/stdlib/math.nxs
blob: f913d825645709d689e9dc39998528a7d2b927fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
;; some bootstrapping needed in order to obtain more complicated functions;
;; the power series requires a factorial and integer power function
(bind powi (lambda (x y)
	(if (= y 1)
	x
	(* x (pow x (- y 1)))
)))
(bind factorial (lambda (n)
        (if (= n 0) 1 (* n (factorial (print(- n 1)))))))

;; complicated functions
(bind exp (lambda (x) x))

(bind ln (lambda (x) x))

(bind sin (lambda (x) x))

(bind cos (lambda (x) x))

(bind tan (lambda (x) (/ (sin x) (cos x))))