A calculus of the absurd

4.9.2 As a function

One way to define the modulus function is, well, as a function. As the function always needs to be positive, we can write that

\begin{equation} \abs {x} = \begin{cases} x & x \geqq 0 \\ -1 \cdot x & x < 0 \end {cases} \end{equation}

What this means is that in the case where \(x\) (the input to the modulus function) is bigger than zero, we just return \(x\). If \(x\) is smaller than zero, we multiply it by \(-1\) in order to make it positive.