HH\Lib\Math\sum_float
Returns the float sum of the values of the given Traversable
namespace HH\Lib\Math;
function sum_float<T as num>(
Traversable<T> $traversable,
): float;
For an integer sum, see Math\sum()
.
Parameters
Traversable<T>
$traversable
Returns
float
Examples
$v = vec[2.3, 1, 4.15];
$sum = Math\sum_float($v);
echo "Float sum of array is $sum \n";