< Perl Programming < Keywords

The abs keyword

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

Syntax

  abs VALUE
  abs

Examples

The code
print abs(-21.7*.36);
returns with
7.812
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.