Puppet Function: math::exp
- Defined in:
- functions/exp.pp
- Function type:
- Puppet Language
Summary
Performs exponential (power) calculation on given numberOverview
Produces a Integer that is an exponential power calculation on the provided value and power.
Note:
puppet has a integer size limit so some values may not work and return a Puppet::ParseError
8 9 10 11 12 |
# File 'functions/exp.pp', line 8
function math::exp(Numeric $x, Integer[0,62] $y) >> Numeric {
if $y == 0 { return $x }
$loops = range(1,$y - 1)
$loops.reduce($x) |$acc, $_value | { $acc * $x }
}
|