ArithFunct/alexejbag208
ArithFunct/kett_x
n1from math import*n
2 
3 
4def ADD(f, g):1def ADD(f, g):
5    if callable(f) and callable(g):2    if callable(f) and callable(g):
n6        def h(x):n3        def NEWADD(x):
7            return f(x) + g(x)4            return f(x) + g(x)
n8        return hn5        return NEWADD
9 
10    if callable(f):6    elif callable(f):
11        def h(x):7        def NEWADD(x):
12            return f(x) + g8            return f(x) + g
n13        return hn9        return NEWADD
14 
15    if callable(g):10    elif callable(g):
16        def h(x):11        def NEWADD(x):
17            return f + g(x)12            return f + g(x)
n18        return hn13        return NEWADD
19 14    else:
20    def h(x):15        def NEWADD(x):
21        return f + g16            return f + g
22    return h17        return NEWADD
2318
2419
25def SUB(f, g):20def SUB(f, g):
26    if callable(f) and callable(g):21    if callable(f) and callable(g):
n27        def h(x):n22        def NEWSUB(x):
28            return f(x) - g(x)23            return f(x) - g(x)
n29        return hn24        return NEWSUB
30 
31    if callable(f):25    elif callable(f):
32        def h(x):26        def NEWSUB(x):
33            return f(x) - g27            return f(x) - g
n34        return hn28        return NEWSUB
35 
36    if callable(g):29    elif callable(g):
37        def h(x):30        def NEWSUB(x):
38            return f - g(x)31            return f - g(x)
n39        return hn32        return NEWSUB
40 33    else:
41    def h(x):34        def NEWSUB(x):
42        return f - g35            return f - g
43    return h36        return NEWSUB
4437
4538
46def MUL(f, g):39def MUL(f, g):
47    if callable(f) and callable(g):40    if callable(f) and callable(g):
n48        def h(x):n41        def NEWMUL(x):
49            return f(x) * g(x)42            return f(x) * g(x)
n50        return hn43        return NEWMUL
51 
52    if callable(f):44    elif callable(f):
53        def h(x):45        def NEWMUL(x):
54            return f(x) * g46            return f(x) * g
n55        return hn47        return NEWMUL
56 
57    if callable(g):48    elif callable(g):
58        def h(x):49        def NEWMUL(x):
59            return f * g(x)50            return f * g(x)
n60        return hn51        return NEWMUL
61 52    else:
62    def h(x):53        def NEWMUL(x):
63        return f * g54            return f * g
64    return h55        return NEWMUL
6556
6657
67def DIV(f, g):58def DIV(f, g):
68    if callable(f) and callable(g):59    if callable(f) and callable(g):
n69        def h(x):n60        def NEWDIV(x):
70            return f(x) / g(x)61            return f(x) / g(x)
n71        return hn62        return NEWDIV
63    elif callable(f):
64        def NEWDIV(x):
65            return f(x) / g
66        return NEWDIV
67    elif callable(g):
68        def NEWDIV(x):
69            return f / g(x)
70        return NEWDIV
71    else:
72        def NEWMUL(x):
73            return f / g
74        return NEWMUL
7275
t73    if callable(f):t
74        def h(x):
75            return f(x) / g
76        return h
77 
78    if callable(g):
79        def h(x):
80            return f / g(x)
81        return h
82 
83    def h(x):
84        return f / g
85    return h
86 
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op