Usephul

Math

Table of Contents

Functions

greatest()  : TValue
Finds the value that is greater than all the other values.
least()  : TValue
Finds the value that is less than all the other values.
rank()  : mixed
Returns the ordinal rank for a given value.

Functions

greatest()

Finds the value that is greater than all the other values.

greatest(TValue $value1, TValue $value2, array<string|int, TValue...$values) : TValue
Parameters
$value1 : TValue

Any rankable value.

$value2 : TValue

Any rankable value.

$values : array<string|int, TValue>

Any rankable values.

Return values
TValue

least()

Finds the value that is less than all the other values.

least(TValue $value1, TValue $value2, array<string|int, TValue...$values) : TValue
Parameters
$value1 : TValue

Any rankable value.

$value2 : TValue

Any rankable value.

$values : array<string|int, TValue>

Any rankable values.

Return values
TValue

rank()

Returns the ordinal rank for a given value.

rank(TValue $value) : mixed

This rank can be compared reliably using traditional comparison operators, like < and >=.

Parameters
$value : TValue

The value to rank.

Return values
mixed

A value that represents the ordinal rank for the given value.


        
On this page

Search results