Adventure Documentation

Math extends PlatformUtility
in package

Provides access to math utility functions.

Tags

Table of Contents

ceil()  : float
Ceil a numerical value.
floor()  : float
Floor a numerical value.
max()  : int
Get the numerically highest value of the provided parameters.
min()  : int
Get the numerically lowest value of the provided parameters.
random()  : int
Get a random integer between min and max.
round()  : float
Round a numerical value to a given precision.

Methods

ceil()

Ceil a numerical value.

public ceil(mixed $value) : float
Parameters
$value : mixed
Tags
throws
InvalidArgumentException
see
ceil()
Return values
float

floor()

Floor a numerical value.

public floor(mixed $value) : float
Parameters
$value : mixed
Tags
throws
InvalidArgumentException
see
floor()
Return values
float

max()

Get the numerically highest value of the provided parameters.

public max(mixed ...$values) : int
Parameters
$values : mixed
Tags
see
max()
Return values
int

min()

Get the numerically lowest value of the provided parameters.

public min(mixed ...$values) : int
Parameters
$values : mixed
Tags
see
min()
Return values
int

random()

Get a random integer between min and max.

public random([int $min = 0 ][, int|null $max = null ]) : int
Parameters
$min : int = 0
$max : int|null = null
Tags
see
mt_rand()
Return values
int

round()

Round a numerical value to a given precision.

public round(mixed $value, int $precision[, int $mode = PHP_ROUND_HALF_UP ]) : float
Parameters
$value : mixed
$precision : int
$mode : int = PHP_ROUND_HALF_UP
Tags
throws
InvalidArgumentException
see
round()
Return values
float

        

Search results