PHP Class MathPHP\Functions\Map\Single

Afficher le fichier Open project: markrogoyski/math-php Class Usage Examples

Méthodes publiques

Méthode Description
abs ( array $xs ) : array Map absolute value
add ( array $xs, number $k ) : array Map addition
cube ( array $xs ) : array Map cube
divide ( array $xs, number $k ) : array Map Divide
max ( array $xs, number $value ) : array Map max value Each element in the array is compared against the value, and the max of each is returned.
min ( array $xs, number $value ) : array Map min value Each element in array is compared against the value, and the min of each is returned.
multiply ( array $xs, number $k ) : array Map multiply
pow ( array $xs, $n ) : array Map raise to a power
sqrt ( array $xs ) : array Map square root
square ( array $xs ) : array Map square
subtract ( array $xs, number $k ) : array Map subtract

Method Details

abs() public static méthode

Map absolute value
public static abs ( array $xs ) : array
$xs array
Résultat array

add() public static méthode

Map addition
public static add ( array $xs, number $k ) : array
$xs array
$k number Number to add to each element
Résultat array

cube() public static méthode

Map cube
public static cube ( array $xs ) : array
$xs array
Résultat array

divide() public static méthode

Map Divide
public static divide ( array $xs, number $k ) : array
$xs array
$k number Number to divide each element by
Résultat array

max() public static méthode

Map max value Each element in the array is compared against the value, and the max of each is returned.
public static max ( array $xs, number $value ) : array
$xs array
$value number
Résultat array

min() public static méthode

Map min value Each element in array is compared against the value, and the min of each is returned.
public static min ( array $xs, number $value ) : array
$xs array
$value number
Résultat array

multiply() public static méthode

Map multiply
public static multiply ( array $xs, number $k ) : array
$xs array
$k number Number to multiply to each element
Résultat array

pow() public static méthode

Map raise to a power
public static pow ( array $xs, $n ) : array
$xs array
Résultat array

sqrt() public static méthode

Map square root
public static sqrt ( array $xs ) : array
$xs array
Résultat array

square() public static méthode

Map square
public static square ( array $xs ) : array
$xs array
Résultat array

subtract() public static méthode

Map subtract
public static subtract ( array $xs, number $k ) : array
$xs array
$k number Number to subtract from each element
Résultat array