mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 09:23:09 +00:00
docs: Document mathematical functions
This commit is contained in:
parent
7747fbfc99
commit
4e6a81ebe7
|
@ -621,6 +621,50 @@ All templates have the following functions available to them:
|
|||
*lt* _arg1_, _arg2_
|
||||
Returns the boolean truth of _arg1_ < _arg2_.
|
||||
|
||||
*math.Add* _arg1_, _arg2_
|
||||
Returns _arg1_ + _arg2_ as an integer if both arguments are
|
||||
integers, otherwise as a float.
|
||||
|
||||
*math.Sub* _arg1_, _arg2_
|
||||
Returns _arg1_ - _arg2_ as an integer if both arguments are
|
||||
integers, otherwise as a float.
|
||||
|
||||
*math.Mul* _arg1_, _arg2_
|
||||
Returns _arg1_ \* _arg2_ as an integer if both arguments are
|
||||
integers, otherwise as a float.
|
||||
|
||||
*math.Div* _arg1_, _arg2_
|
||||
Returns _arg1_ / _arg2_ as a float.
|
||||
|
||||
*math.Mod* _arg1_, _arg2_
|
||||
Returns _arg1_ % _arg2_ as an integer.
|
||||
|
||||
*math.Ceil* _arg_
|
||||
Returns the least integer value greater than or equal to _arg_.
|
||||
|
||||
*math.Floor* _arg_
|
||||
Returns the greatest integer value less than or equal to _arg_.
|
||||
|
||||
*math.Log* _arg_
|
||||
Returns the natural logarithm of _arg_ as a float.
|
||||
|
||||
*math.Max* _arg1_, _arg2_
|
||||
Returns the greater of _arg1_ and _arg2_ as an integer if both arguments are
|
||||
integers, otherwise as a float.
|
||||
|
||||
*math.Min* _arg1_, _arg2_
|
||||
Returns the lesser of _arg1_ and _arg2_ as an integer if both arguments are
|
||||
integers, otherwise as a float.
|
||||
|
||||
*math.Pow* _arg1_, _arg2_
|
||||
Returns _arg1_ ^ _arg2_ as a float.
|
||||
|
||||
*math.Round* _arg_
|
||||
Returns the nearest integer to _arg_, rounding half away from zero.
|
||||
|
||||
*math.Sqrt* _arg_
|
||||
Returns square root of _arg_ as a float.
|
||||
|
||||
*ne* _arg1_, _arg2_
|
||||
Returns the boolean truth of _arg1_ != _arg2_.
|
||||
|
||||
|
|
Loading…
Reference in a new issue