HH\Lib\Math\abs

This API is part of the Hack Standard Library, not HHVM itself.
Facebook Engineer?

This function is available as Math\abs() in Facebook's www repository.

Returns the absolute value of $number ($number if $number > 0, -$number if $number < 0)

Description

namespace HH\Lib\Math;

function abs<T as num>(
  T $number,
): T;

Parameters

  • T $number