This shows you the differences between two versions of the page.
en:public:developer:template_system:tags:expression:calc [2012/11/19 11:51] admin |
en:public:developer:template_system:tags:expression:calc [2015/02/05 16:06] (current) svanderclock [<#Calc>] |
||
---|---|---|---|
Line 3: | Line 3: | ||
A parser, compiler and interpreter for mathematical expressions. It can handle normal arithmetics (includings powers wit ^) and builtin functions like sin(). | A parser, compiler and interpreter for mathematical expressions. It can handle normal arithmetics (includings powers wit ^) and builtin functions like sin(). | ||
Multiplication *, division / and modulo mod have the same precedence, and are evaluated left to right. | Multiplication *, division / and modulo mod have the same precedence, and are evaluated left to right. | ||
+ | |||
+ | **NOTE:** the input always use the '.' as decimalseparator. The output use the decimalseparator of the current language | ||
Line 13: | Line 15: | ||
<code> | <code> | ||
- | <#url_PageNumber> mod 10 = <#calc expression="<#url_PageNumber> mod 10"> | + | <#var name=MyNumber Value=100> |
+ | <#var name=MyNumber> mod 10 = <#calc expression="<#var name=MyNumber> mod 10"> | ||
+ | </code> | ||
+ | |||
+ | The above example will output: | ||
+ | |||
+ | <code> | ||
+ | 100 mod 10 = 10 | ||
</code> | </code> |