|This article is about a CAOS command or function.|
|Return type||[[CAOS types|]]|
ABSV makes the numeric value of a variable positive.
Syntax: ABSV X(variable)
This makes the numeric value contained in X positive, i.e. gives it its absolute value. To be precise, if X is less than 0, X is set to the negative of X (e.g. -5 is changed to 5), otherwise, it is left unchanged.
Mathematically, this is normally written as |x|. It's equivalent to the 'abs' function in various other languages.
This code sets va00 to -4, and then uses ABSV on it, changing it to 4.
SETV VA00 -4 ABSV VA00