ABS


abs( a )
abs "absolute"
a a number

The abs( a ) function is used to return the absolute number of the number given.

To understand what an absolute value is, imagine you are standing at any point on a number line and you want to know how far away from zero you are, no matter which side of zero you are standing (positive or negative). This is why the absolute value will always be a positive number.



For example:

a = abs(5)     --5
b = abs(-42)   --42

c = abs(3.75)  --3.75
d = abs(-6.25) --6.25

Images in this Guide by NerdyTeachers is licensed under CC BY-SA 4.0

650

31 Jul 2024

Font