HH\Lib\Math\sum_float

Meta Engineer?

This is available as Math\sum_float in the www repository.

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

Returns

  • float

Examples

$v = vec[2.3, 1, 4.15];
$sum = Math\sum_float($v);
echo "Float sum of array is $sum \n";