Index

cArithmeticOperator

MMO\math\enums · 1 symbol · generated 30 Sep 2026

enum

cArithmeticOperator

cArithmeticOperator.php:17
enum MMO\math\enums\cArithmeticOperator: string implements MMO\math\interfaces\iStandardOperator, MMO\math\interfaces\iInversibleOperator
Namespace
MMO\math\enums
Implements
iStandardOperator, iInversibleOperator

Index

Divide
Minus
Multiply
Plus
Power
name readonly
value readonly
cases() static
commute($args)Commutate operation (reverse order of arguments)
from($value) static
inverseEquality($result, $args)Reverse operator by expressing the first argument against the result and the second argument.
priority()
toNumber($args)
tryFrom($value) static
units($args)
__invoke($args)

Constants5

Divide

const Divide = MMO\math\enums\cArithmeticOperator::Divide

Minus

const Minus = MMO\math\enums\cArithmeticOperator::Minus

Multiply

const Multiply = MMO\math\enums\cArithmeticOperator::Multiply

Plus

const Plus = MMO\math\enums\cArithmeticOperator::Plus

Power

const Power = MMO\math\enums\cArithmeticOperator::Power

Properties2

name

readonly
readonly string $name
Type
string

value

readonly
readonly string $value
Type
string

Methods9

cases()

static
static function cases(): array
returnsarray

from($value)

static
static function from(string|int $value): static
$valuestring | int
returnsstatic

inverseEquality($result, $args)

cArithmeticOperator.php:122

Reverse operator by expressing the first argument against the result and the second argument.

function inverseEquality( MMO\math\interfaces\iNumber|int|float|null $result, MMO\math\interfaces\iNumber|int|float ...$args ): MMO\math\interfaces\iNumber|int|float
$resultiNumber | int | float | nullthe result can be null except for power
...$argsiNumber | int | floatthe argument for this operator (first argument is ignored as it is the one beeing inversed)
returnsiNumber | int | float
a + b = result <=> a = result - b

tryFrom($value)

static
static function tryFrom(string|int $value): ?static
$valuestring | int
returnsnull | static