Perl Programming/Keywords/abs

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: __PACKAGE__ Keywords Next: accept

The abs keyword[edit | edit source]

Function abs returns the absolute value of VALUE, or of $_, if VALUE is omitted.

Syntax[edit | edit source]

  abs VALUE
  abs

Examples[edit | edit source]

The code
print abs(-21.7*.36);
returns with
7.812


Previous: __PACKAGE__ Keywords Next: accept