function Calculator::fromBase
Converts a number from an arbitrary base.
This method can be overridden by the concrete implementation if the underlying library has built-in support for base conversion.
Parameters
string $number The number, positive or zero, non-empty, case-insensitively validated for the given base.:
int $base The base of the number, validated from 2 to 36.:
Return value
string The converted number, following the Calculator conventions.
1 method overrides Calculator::fromBase()
- GmpCalculator::fromBase in vendor/
brick/ math/ src/ Internal/ Calculator/ GmpCalculator.php - Converts a number from an arbitrary base.
File
-
vendor/
brick/ math/ src/ Internal/ Calculator.php, line 320
Class
- Calculator
- Performs basic operations on arbitrary size integers.
Namespace
Brick\Math\InternalCode
public function fromBase(string $number, int $base) : string {
return $this->fromArbitraryBase(\strtolower($number), self::ALPHABET, $base);
}