Arithmetic
Ygdrasil does not handle arithmetic and math in the same way as other programming languages. Since it is not actually a procedural language, there is no place to write in arithmetic expressions. Instead, all math has to be done with groups of nodes. Each of the arithmetic nodes (add, subtract, multiply, and divide) uses its children to calculate the expression.Addition
C = A + B
add C ()
{
value A ()
value B ()
}
Subtraction
C = A - B
subtract C ()
{
value A ()
value B ()
}
Multiplication
C = A * B
multiply C ()
{
value A ()
value B ()
}
Division
C = A / B
divide C ()
{
value A ()
value B ()
}
(c) Ben Chang