Add math.Max and math.Min

Closes #8583
This commit is contained in:
Joe Mooring
2021-05-27 08:34:49 -07:00
committed by Bjørn Erik Pedersen
parent 845a7ba4fc
commit 01758f99b9
4 changed files with 129 additions and 12 deletions

View File

@@ -64,10 +64,17 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Sqrt,
ns.AddMethodMapping(ctx.Max,
nil,
[][2]string{
{"{{math.Sqrt 81}}", "9"},
{"{{math.Max 1 2 }}", "2"},
},
)
ns.AddMethodMapping(ctx.Min,
nil,
[][2]string{
{"{{math.Min 1 2 }}", "1"},
},
)
@@ -106,6 +113,13 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Sqrt,
nil,
[][2]string{
{"{{math.Sqrt 81}}", "9"},
},
)
ns.AddMethodMapping(ctx.Sub,
[]string{"sub"},
[][2]string{