mini\Util\Math\Expr::normalize()
Method
private
static
Signature
private static function normalize(mini\Util\Math\NumberInterface|self|string|int|float $value): self|mini\Util\Math\NumberInterface
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value |
mini\Util\Math\NumberInterface|self|string|int|float |
required | Documentation missing |
Returns
Documentation
Normalize input to Expr or NumberInterface
Allows ergonomic API: $val->pow('1/2') instead of $val->pow(new Expr('/', 1, 2))
- Expr: returned as-is
- NumberInterface: returned as-is
- int/float: converted to Decimal
- string with operators: parsed as expression ('1/2', '2+3', etc.)
- numeric string: converted to Decimal