rpn is a simple and lightweight solution for basic math operations. It is inspired by formerly popular calculators using Reverse Polish Notation. See Wikipedia for more info.
<<rpn 2 50 *>>
Features:
Have fun and good night!
Thomas
\define foo() <<rpn 2 2 *>>
<$wikify name=f text=<<foo>>>
<$macrocall $name="rpn" a=<<rpn 2 2 *>> b=<<f>> operation="*"/>
</$wikify>
<<calc 1 /3 decimals:4>>
<<calc 0 +1.5500 decimals:4>>
<<calc 0 +1.5 decimals:0>> – the 5 in 1.5 is rounded (up)
<<calc 1 +1.555>> – the last 5 is floored
---
calc has 2444 characters, rpn.js has 1305
<<calc 2444 /1305 >>
that is a plus of 87 percent
<$macrocall $name="rpn" a=<<rpn 2 2 *>> b=<<rpn 2 2 *>> operation="*"/>
\define tot_words()
<$wikfiy name=wpt text=<<words_per_tid>> >
<$wikfiy name=not text=<<nr_of_tids>> >
<$macrocall $name="rpn" a=<<wpt>> b=<<not>> operation="*" />
</$wikify>
</$wikify>
\end
Total words in my wikis:
<$wikify name=tw text=<<tot_words>>>
<$macrocall $name="rpn" a=<<tw>> b="10" operation="*"/>
</$wikify>
\define tot_words() <$macrocall $name="rpn" a=<<words_per_tid>> b=<<nr_of_tids>> operation="*" />
Total words in my wikis:
<$macrocall $name="rpn" a=<<tot_words>> b="10" operation="*"/>
The short answer is: no.
Maybe one of the prior existing alternatives is what you are looking for: http://mathcell.tiddlyspot.com/
Happy calculating!
Thomas
<$macrocall $name="rpn" a=<<rpn 20 20 +>> b=<<rpn 3 10 *>> operation="%"/>
\define a() <<rpn 1 2 +>>
\define b() <<rpn 3 4 +>>
<$macrocall $name="rpn" a=<<a>> b=<<b>> operation="+"/>