From 748dfb0c3f934bb0196d5714749b43ce7b6ec048 Mon Sep 17 00:00:00 2001 From: Edd Salkield Date: Fri, 1 Jul 2022 16:54:51 +0100 Subject: [PATCH] docs: Document mathematical functions --- docs/kiln.1.scd | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/kiln.1.scd b/docs/kiln.1.scd index e995581..fd03927 100644 --- a/docs/kiln.1.scd +++ b/docs/kiln.1.scd @@ -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_.