function Calculator::abs
Returns the absolute value of a number.
3 calls to Calculator::abs()
- Calculator::divRound in vendor/
brick/ math/ src/ Internal/ Calculator.php - Performs a rounded division.
- Calculator::gcd in vendor/
brick/ math/ src/ Internal/ Calculator.php - Returns the greatest common divisor of the two numbers.
- Calculator::modInverse in vendor/
brick/ math/ src/ Internal/ Calculator.php - Returns the modular multiplicative inverse of $x modulo $m.
File
-
vendor/
brick/ math/ src/ Internal/ Calculator.php, line 107
Class
- Calculator
- Performs basic operations on arbitrary size integers.
Namespace
Brick\Math\InternalCode
public final function abs(string $n) : string {
return $n[0] === '-' ? \substr($n, 1) : $n;
}