fn: /=
[contents]

Contents

Syntax

The syntax for /= calls is:

f++:  
/=(params)

n++:  
@/=(params)

Description

/= is the arithmetic assignment operator for division, it takes $n \geq 2$ input parameters $p_1, \ldots, p_n$ where $p_1$ should be a variable name and the remainder should all be numbers, it sets $p_1 = p_2 / \ldots / p_n$ performed from left to right. For example, $/=(p_1, p_2, p_3, p_4) \Leftrightarrow p_1 = p_2 / p_3 / p_4 = \frac{\frac{p_2}{p_3}}{p_4}$.

Note: It is typically faster to use exprtk for arithmetic assignment operators, plus the syntax is nicer.

f++ example

Example of /= being used with f++:

:=(int, a=150, b=10)
/=(a, b, 5)
console(a)

n++ example

Example of /= being used with n++:

@:=(int, a=150, b=10)
@/=(a, b, 5)
@console(a)

Sponsors