ArithFunct/kabaczek | ArithFunct/Bernard04 | ||||
---|---|---|---|---|---|
n | 1 | def ADD(f, g): | n | 1 | def ADD(a, b): |
2 | def h(x): | 2 | def h(x): | ||
n | 3 | if callable(f): | n | 3 | if callable(a): |
4 | f_1 = f(x) | 4 | c = a(x) | ||
5 | else: | 5 | else: | ||
n | 6 | f_1 = f | n | 6 | c = a |
7 | |||||
7 | if callable(g): | 8 | if callable(b): | ||
8 | g_1 = g(x) | 9 | d = b(x) | ||
9 | else: | 10 | else: | ||
n | 10 | g_1 = g | n | 11 | d = b |
12 | |||||
11 | return f_1 + g_1 | 13 | return c + d | ||
14 | |||||
12 | return h | 15 | return h | ||
13 | 16 | ||||
14 | 17 | ||||
n | 15 | def SUB(f, g): | n | 18 | def SUB(a, b): |
16 | def h(x): | 19 | def h(x): | ||
n | 17 | if callable(f): | n | 20 | if callable(a): |
18 | f_1 = f(x) | 21 | c = a(x) | ||
19 | else: | 22 | else: | ||
n | 20 | f_1 = f | n | 23 | c = a |
24 | |||||
21 | if callable(g): | 25 | if callable(b): | ||
22 | g_1 = g(x) | 26 | d = b(x) | ||
23 | else: | 27 | else: | ||
n | 24 | g_1 = g | n | 28 | d = b |
29 | |||||
25 | return f_1 - g_1 | 30 | return c - d | ||
31 | |||||
26 | return h | 32 | return h | ||
27 | 33 | ||||
28 | 34 | ||||
n | 29 | def MUL(f, g): | n | 35 | def MUL(a, b): |
30 | def h(x): | 36 | def h(x): | ||
n | 31 | if callable(f): | n | 37 | if callable(a): |
32 | f_1 = f(x) | 38 | c = a(x) | ||
33 | else: | 39 | else: | ||
n | 34 | f_1 = f | n | 40 | c = a |
41 | |||||
35 | if callable(g): | 42 | if callable(b): | ||
36 | g_1 = g(x) | 43 | d = b(x) | ||
37 | else: | 44 | else: | ||
n | 38 | g_1 = g | n | 45 | d = b |
46 | |||||
39 | return f_1 * g_1 | 47 | return c * d | ||
48 | |||||
40 | return h | 49 | return h | ||
41 | 50 | ||||
42 | 51 | ||||
n | 43 | def DIV(f, g): | n | 52 | def DIV(a, b): |
44 | def h(x): | 53 | def h(x): | ||
n | 45 | if callable(f): | n | 54 | if callable(a): |
46 | f_1 = f(x) | 55 | c = a(x) | ||
47 | else: | 56 | else: | ||
n | 48 | f_1 = f | n | 57 | c = a |
58 | |||||
49 | if callable(g): | 59 | if callable(b): | ||
50 | g_1 = g(x) | 60 | d = b(x) | ||
51 | else: | 61 | else: | ||
t | 52 | g_1 = g | t | 62 | d = b |
63 | |||||
53 | return f_1/g_1 | 64 | return c / d | ||
65 | |||||
54 | return h | 66 | return h | ||
55 | 67 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|