Abbreviation for absolute value, usually meaning the length of a vector, be it a one-dimentional number, a two-dimentional complex number, or any n-dimentional vector. The absolute value of the vector v is written abs(v) or |v|. Some examples:

abs(-42) = 42
abs(3.14) = 3.14
|(3,4i)| = sqrt(32 + 42) = sqrt(25) = 5
abs((5,8,2,1)) = sqrt(52 + 82 + 22 + 12) = sqrt(94) = 9.695359...

Perl command.

abs value

Like in many other programming languages, in Perl abs returns the absolute value of its argument value. If the argument is omitted, abs uses $_.

Back to Perl.

Log in or register to write something here or to contact authors.