```{index} single: abs; POSIX function ``` ```{index} single: POSIX::abs; Perl function ``` # abs Integer absolute value of `$n`. ## Synopsis ```perl my $n = POSIX::abs(-7); # 7 ``` ## What you get back An integer scalar. Unlike the core `abs` built-in, the argument is coerced to IV before taking the absolute value, so floating-point inputs are truncated. ## Differences from upstream Fully compatible with upstream POSIX.