Puppet Function: math::sum
- Defined in:
- functions/sum.pp
- Function type:
- Puppet Language
Summary
Produces a sum of all the numbersOverview
Produces a Integer that is sum of all the numbers provided. Can take arrays or multiple values.
Note:
puppet has a integer size limit so some values may not work and return a Puppet::ParseError
8 9 10 |
# File 'functions/sum.pp', line 8
function math::sum(Variant[Numeric, Array[Numeric], Tuple] *$value ) >> Numeric {
$value.flatten.reduce | Numeric $acc, Numeric $v| { $acc + $v }
}
|