Table of contents
Namespace: Com\Tecnick\Barcode
final class Math
Source: src/Math.php:34
Arbitrary precision arithmetic on non-negative decimal integer strings. The bcmath extension is used when available, otherwise the equivalent pure-PHP implementation is used, so bcmath is an optional dependency.
Methods
add()
Add two non-negative decimal integers.
public static add(string $left, string $right): numeric-string
Parameters:
$left(string): First operand$right(string): Second operand
Returns: numeric-string
Source: src/Math.php:69
div()
Integer division of two non-negative decimal integers.
public static div(string $left, string $right): numeric-string
Parameters:
$left(string): Dividend$right(string): Divisor
Returns: numeric-string
Source: src/Math.php:103
fallbackAdd()
Add two non-negative decimal integers without bcmath.
public static fallbackAdd(string $left, string $right): numeric-string
Parameters:
$left(string): First operand$right(string): Second operand
Returns: numeric-string
Source: src/Math.php:137
fallbackDiv()
Integer division of two non-negative decimal integers without bcmath.
public static fallbackDiv(string $left, string $right): numeric-string
Parameters:
$left(string): Dividend$right(string): Divisor
Returns: numeric-string
Source: src/Math.php:219
fallbackMod()
Remainder of the integer division of two non-negative decimal integers without bcmath.
public static fallbackMod(string $left, string $right): numeric-string
Parameters:
$left(string): Dividend$right(string): Divisor
Returns: numeric-string
Source: src/Math.php:232
fallbackMul()
Multiply two non-negative decimal integers without bcmath.
public static fallbackMul(string $left, string $right): numeric-string
Parameters:
$left(string): First operand$right(string): Second operand
Returns: numeric-string
Source: src/Math.php:172
hasBcmath()
Returns true if the bcmath functions are available.
public static hasBcmath(): bool
Returns: bool
Source: src/Math.php:52
mod()
Remainder of the integer division of two non-negative decimal integers.
public static mod(string $left, string $right): numeric-string
Parameters:
$left(string): Dividend$right(string): Divisor
Returns: numeric-string
Source: src/Math.php:120
mul()
Multiply two non-negative decimal integers.
public static mul(string $left, string $right): numeric-string
Parameters:
$left(string): First operand$right(string): Second operand
Returns: numeric-string
Source: src/Math.php:86