MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

MMO\math

MMO\math · 19 symboles · générée le 27 Oct 2026

function

binomialCoefficient

functions.php:189

Compute the binomial coefficient $n! / ($k! * ($n - $k)!)

function binomialCoefficient(int $n, int $k): float
Espace de noms
MMO\math
$nint
$kint
retournefloat
Graphe d'appels

Utilise (1)

Utilisé par (1)

function

bisection

functions.php:203

Find a root of a continuous function (fn(x) = 0) using the bisection method

function bisection(callable $fn, int|float $a, int|float $b, int|float $epsilon = 0.01): ?float
Espace de noms
MMO\math
Voir
https://www.geeksforgeeks.org/dsa/program-for-bisection-method/ WARNING: this only determine ONE solution of all the possible solutions
$fncallablefunction(x):int|float
$aint | floatthe smallest number to try from
$bint | floatthe biggest number to try from
$epsilon = 0.01int | floatthe minimal step
retournenull | floatif null, could not determine a solution
function

compare

functions.php:76

Compare two values

function compare(mixed $a, mixed $b): int|bool
Espace de noms
MMO\math
$amixed
$bmixed
retourneint | bool-1 : $a < $b 0 : $a == $b 1 : $a > $b true: $a === $b
Graphe d'appels
function

divide

functions.php:138
function divide(MMO\math\interfaces\iNumber|int|float ...$args): MMO\math\interfaces\iNumber|int|float
Espace de noms
MMO\math
...$argsiNumber | int | float
retourneiNumber | int | float
Graphe d'appels
function

factorial

functions.php:176

Do factorial of $n n! = n * (n-1) * (n-2) * ........ * 1

function factorial(int $n): int
Espace de noms
MMO\math
$nint
retourneint
Graphe d'appels

Utilisé par (1)

function

isNumber

functions.php:44

Test if a value is a float, int or iNumber

function isNumber(mixed $value): bool
Espace de noms
MMO\math
$valuemixed
retournebool
function

loopValues

functions.php:255

Get the numbers a value stands for (used by max, min and size) Plain numbers and set iNumber yield their value, an unset iNumber yields nothing, an iDomain (Interval, Domain) yields its limit (start and end, open bounds included as their limit) and any other IteratorAggregate is walked

function loopValues(MMO\math\interfaces\iNumber|IteratorAggregate|int|float $value): Generator
Espace de noms
MMO\math
$valueiNumber | IteratorAggregate | int | float
retourneGeneratorint|float
Graphe d'appels

Utilise (2)

Utilisé par (3)

function

max

functions.php:284

Get the maximum value of a list of numbers (iNumber included)

function max(MMO\math\interfaces\iNumber|IteratorAggregate|int|float ...$values): int|float|null
Espace de noms
MMO\math
...$valuesiNumber | IteratorAggregate | int | float
retourneint | float | nullnull if no value is known
max(1, 5, 3); //5 max(new Domain([1, 2], [3, 4]), 2); //4.0 max(new Number()); //null
Graphe d'appels

Utilise (1)

Utilisé par (1)

function

min

functions.php:303

Get the minimum value of a list of numbers (iNumber included)

function min(MMO\math\interfaces\iNumber|IteratorAggregate|int|float ...$values): int|float|null
Espace de noms
MMO\math
...$valuesiNumber | IteratorAggregate | int | float
retourneint | float | nullnull if no value is known
min(1, 5, 3); //1 min(new Domain([1, 2], [3, 4]), 2); //1.0 min(new Number()); //null
Graphe d'appels

Utilise (1)

Utilisé par (1)

function

minus

functions.php:95
function minus(MMO\math\interfaces\iNumber|int|float ...$args): MMO\math\interfaces\iNumber|int|float
Espace de noms
MMO\math
...$argsiNumber | int | float
retourneiNumber | int | float
Graphe d'appels
function

multiply

functions.php:112

Multiply any number (iNumber included) by a factor

function multiply(MMO\math\interfaces\iNumber|int|float ...$args): MMO\math\interfaces\iNumber|int|float
Espace de noms
MMO\math
...$argsiNumber | int | float
retourneiNumber | int | float
Graphe d'appels
function

number

functions.php:56

Convert any value to a number (int|float)

function number(mixed $value, bool $convertNumber = true, bool $ignoreUnits = true): int|float|null
Espace de noms
MMO\math
$valuemixedif a string, the value is parsed and it returns an int if it can or a float. if iNumber, it returns its value
$convertNumber = trueboolif false and it is a iNumber, null is returned
$ignoreUnits = trueboolif false and the number has units, null is returned
retourneint | float | nullif null, the value cannot be converted to a number
Graphe d'appels
function

operatorRegex

functions.php:353

Get a regular expression used to tokenize a math expression (used by parse)

function operatorRegex(): string
Espace de noms
MMO\math
retournestring
Graphe d'appels

Utilisé par (1)

function

parse

functions.php:380

Tokenize a mathematical expression

function parse( array|string $exp, ?callable $variableFactory = null, array $customOperators = [], array &$vars = [] ): MMO\math\interfaces\iNumber|string
Espace de noms
MMO\math
$exparray | stringthe mathematical expression
$variableFactory = nullnull | callablefunction($name): ?iNumber. $name is the name of the variable without '$'. If it returns null, a Number is created
$customOperators = []arraythe custom operators in front of parenthesis (like xxx(..,..)) where xxx is the operator
$vars = []array
retourneiNumber | string
Graphe d'appels

Utilisé par (2)

function

plus

functions.php:84
function plus(MMO\math\interfaces\iNumber|int|float ...$args): MMO\math\interfaces\iNumber|int|float
Espace de noms
MMO\math
...$argsiNumber | int | float
retourneiNumber | int | float
Graphe d'appels
function

power

functions.php:160
function power(MMO\math\interfaces\iNumber|int|float $a, float $power): MMO\math\interfaces\iNumber|int|float
Espace de noms
MMO\math
$aiNumber | int | float
$powerfloat
retourneiNumber | int | float
Graphe d'appels
function

roundScale

functions.php:23

Round value to the closest power of ten

function roundScale(int|float $value, int $scale = 0, ?bool $roundUp = null): float
Espace de noms
MMO\math
$valueint | float
$scale = 0intif < 0, it is a numeral precision. ex: -1 => precise to 0.1, -3 => 0.001 if > 0, it is rounded to the closest value. ex: 2 => rounded to 100. 0 => 1, 6 => 1 000 000
$roundUp = nullnull | bool
retournefloat
Graphe d'appels
function

scale

functions.php:34

Get the power of ten the given value is precise to

function scale(int|float $value): int
Espace de noms
MMO\math
$valueint | float
retourneint
Graphe d'appels
function

size

functions.php:323

Get the number of values in the given values

function size(MMO\math\interfaces\iNumber|IteratorAggregate|int|float ...$values): int|float
Espace de noms
MMO\math
...$valuesiNumber | IteratorAggregate | int | float
retourneint | floatINF if a value holds a range of numbers
size(1, new Number(), new Number(2)); //2 size(new Interval(3, 3)); //1 size(new Interval(1, 2)); //INF
Graphe d'appels

Utilise (2)

Utilisé par (1)