providers: Bring math provider back into service

Sprig is missing some float math functions
This commit is contained in:
2024-12-21 02:06:19 -05:00
parent a1570ddbeb
commit adf77c962d
2 changed files with 5 additions and 20 deletions

View File

@@ -19,27 +19,10 @@ func (this *Provider) Package () string {
// FuncMap fulfills the step.FuncProvider interface.
func (this *Provider) FuncMap () template.FuncMap {
return template.FuncMap {
"add": funcAdd,
"sub": funcSub,
"mul": funcMul,
"div": funcDiv,
"pow": math.Pow,
"sqrt": math.Sqrt,
"modf": funcModf,
}
}
func funcAdd (a, b float64) float64 {
return a + b
}
func funcSub (a, b float64) float64 {
return a - b
}
func funcMul (a, b float64) float64 {
return a * b
}
func funcDiv (a, b float64) float64 {
return a / b
func funcModf (a, b float64) float64 {
return math.Mod(a, b)
}