summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'content/fate_v1/computations/maths/_index.md')
-rw-r--r--content/fate_v1/computations/maths/_index.md58
1 files changed, 58 insertions, 0 deletions
diff --git a/content/fate_v1/computations/maths/_index.md b/content/fate_v1/computations/maths/_index.md
new file mode 100644
index 0000000..ef0783b
--- /dev/null
+++ b/content/fate_v1/computations/maths/_index.md
@@ -0,0 +1,58 @@
+---
+title: Mathematics
+weight: 1
+---
+
+All operands must be of the same type, which is also the type returned by the
+operation.
+
+### Addition
+{{< fatecode >}}(+ [N0 = NUMBER] ... [NN = NUMBER]){{< /fatecode >}}
+
+Standard addition (minimum of 2 arguments).
+
+### Substraction
+{{< fatecode >}}(- [N0 = NUMBER] ... [NN = NUMBER]){{< /fatecode >}}
+
+Standard substraction (minimum of 2 arguments).
+
+### Multiplication
+{{< fatecode >}}(* [N0 = NUMBER] ... [NN = NUMBER]){{< /fatecode >}}
+
+Standard multiplication (minimum of 2 arguments).
+
+### Division
+{{< fatecode >}}(/ [N0 = NUMBER] [N1 = NUMBER]){{< /fatecode >}}
+
+Standard division. Note that a division on integers is indeed an integer
+division.
+
+### Exponent
+{{< fatecode >}}(^ [N0 = NUMBER] [N1 = NUMBER]){{< /fatecode >}}
+
+Standard exponentiation.
+
+### Modulo
+{{< fatecode >}}(% [I0 = INT] [I1 = INT]){{< /fatecode >}}
+
+Standard modulo operation.
+
+### Minimum
+{{< fatecode >}}(min [N0 = NUMBER] ... [NN = NUMBER]){{< /fatecode >}}
+
+Lowest value among the operands (minimum of 2 arguments).
+
+### Maximum
+{{< fatecode >}}(max [N0 = NUMBER] ... [NN = NUMBER]){{< /fatecode >}}
+
+Highest value among the operands (minimum of 2 arguments).
+
+### Clamp
+{{< fatecode >}}(clamp [N0 = NUMBER] [N1 = NUMBER] [N2 = NUMBER]){{< /fatecode >}}
+
+Equivalent to `(max N0 (min N1 N2))`.
+
+### Absolute
+{{< fatecode >}}(abs [NUMBER]){{< /fatecode >}}
+
+Positive value of `[NUMBER]`.