Abs

Command Summary

Returns the absolute value of a number

Command Syntax

abs(Number)

This command can be used to return the absolute value of a number, or an expression which evaluates to a number.

⁻5→X
abs(x)

Outputs: 5

Optimization

This section includes both ways to optimize use of the command, and other common pieces of code that this command can replace in an optimization. Make sure to mention if the optimization improves speed of the program, size, or both. Sample code should be included too, preferably in the following format:

If X<0
Then
⁻X→X

can be

abs(X)→X
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.