Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git] / defint.cpp
blobe06606e2eb4b8b0d071af362b972a7fffc350777
1 // definite integral
3 #include "stdafx.h"
4 #include "defs.h"
6 #define F p2
7 #define X p3
8 #define A p4
9 #define B p5
11 void
12 eval_defint(void)
14 push(cadr(p1));
15 eval();
16 F = pop();
18 p1 = cddr(p1);
20 while (iscons(p1)) {
22 push(car(p1));
23 p1 = cdr(p1);
24 eval();
25 X = pop();
27 push(car(p1));
28 p1 = cdr(p1);
29 eval();
30 A = pop();
32 push(car(p1));
33 p1 = cdr(p1);
34 eval();
35 B = pop();
37 push(F);
38 push(X);
39 integral();
40 F = pop();
42 push(F);
43 push(X);
44 push(B);
45 subst();
46 eval();
48 push(F);
49 push(X);
50 push(A);
51 subst();
52 eval();
54 subtract();
55 F = pop();
58 push(F);