ArithFunct/zikilop
ArithFunct/OddMood
f1from math import *f1from math import *
22
33
4def ADD(f, g):4def ADD(f, g):
n5    def foo(x):n5    def foo(i):
6        if callable(f):6        if callable(f):
n7            temp1 = f(x)n7            a = f(i)
8        else:8        else:
n9            temp1 = fn9            a = f
10        if callable(g):10        if callable(g):
n11            temp2 = g(x)n11            b = g(i)
12        else:12        else:
n13            temp2 = gn13            b = g
14        return temp1 + temp214        return a + b
15    return foo15    return foo
1616
1717
18def SUB(f, g):18def SUB(f, g):
n19    def foo(x):n19    def foo(i):
20        if callable(f):20        if callable(f):
n21            temp1 = f(x)n21            a = f(i)
22        else:22        else:
n23            temp1 = fn23            a = f
24        if callable(g):24        if callable(g):
n25            temp2 = g(x)n25            b = g(i)
26        else:26        else:
n27            temp2 = gn27            b = g
28        return temp1 - temp228        return a - b
29    return foo29    return foo
3030
3131
32def MUL(f, g):32def MUL(f, g):
n33    def foo(x):n33    def foo(i):
34        if callable(f):34        if callable(f):
n35            temp1 = f(x)n35            a = f(i)
36        else:36        else:
n37            temp1 = fn37            a = f
38        if callable(g):38        if callable(g):
n39            temp2 = g(x)n39            b = g(i)
40        else:40        else:
n41            temp2 = gn41            b = g
42        return temp1 * temp242        return a * b
43    return foo43    return foo
4444
4545
46def DIV(f, g):46def DIV(f, g):
n47    def foo(x):n47    def foo(i):
48        if callable(f):48        if callable(f):
n49            temp1 = f(x)n49            a = f(i)
50        else:50        else:
n51            temp1 = fn51            a = f
52        if callable(g):52        if callable(g):
n53            temp2 = g(x)n53            b = g(i)
54        else:54        else:
n55            temp2 = gn55            b = g
56        return temp1 / temp256        return a / b
57    return foo57    return foo
5858
t59 t
60#f = SUB(sin, cos)
61#print(f(12), sin(12)-cos(12))
62 
63#g = DIV(sin, cos)
64#print(g(pi/6), tan(pi/6))
65 
66#h = MUL(exp, 0.1)
67#print(h(2), e**2/10)
68 
69#t = ADD(lambda s: len(s), sum)
70# print(t(range(5)))
71 
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op