1. XVM Team
  2. XVM
  3. xvm

Commits

Maxim Schedriviy  committed 99e43c4

py_macro: add math functions

Comments (0)

Files changed (1)

File release/configs/py_macro/math.py Modified

View file
  • Ignore whitespace
  • Hide word diff
+# Addition. Сложение.
+@xvm.export('math.sum')
+def sum(a, b):
+    return a + b
+
+# Subtraction. Вычитание.
+@xvm.export('math.sub')
+def razn(a, b):
+    return a - b
+
+# Multiplication. Умножение.
+@xvm.export('math.mul')
+def mul(a, b):
+    return a * b
+
+# Division. Деление.
+@xvm.export('math.div')
+def div(a, b):
+    return a / b
+
+# Raise to power. Возведение в степень.
 @xvm.export('math.pow')
 def pow(a, n):
     return a ** n