Hi Josiah

1) You can pull together three operations like this: 

<$macrocall $name="rpn" a=<<rpn 20 20 +>> b=<<rpn 3 10 *>> operation="%"/>

or like this:

\define a() <<rpn 1 2 +>>
\define b() <<rpn 3 4 +>>

<$macrocall $name="rpn" a=<<a>> b=<<b>> operation="+"/>

If you need more you will have to wikify intermediate results.

2) Not really in the sense of true RPN where you could write "100 10 5 1 + 
* /" but I don’t find that very readabel/understandable so I did not use 
stacks to store operands and operators in. But as demonstrated in 1 it is 
possible with some limits. 

At the moment you can not use macros containing macros or lists as 
parameters. – Maybe I try to add this later or someone can give me a hint … 

All the best,
Thomas


Am Samstag, 8. Juli 2017 22:46:43 UTC+2 schrieb @TiddlyTweeter:
>
> i looked at your gizmo. i'm wondering 
>
> (1) if you can take the result of one calculation and feed it into another?
>
> (2) whether it allows more than one mathematical transformation at a time 
> (like it divides then multiplies then adds)?
>
> Just asking
> Josiah
>
> On Saturday, 8 July 2017 22:37:54 UTC+2, Thomas Elmiger wrote:
>>
>> Hi Saq
>>
>> You were right, that was easy and will be useful. rpn can now do % 
>> calculation as well as round upwards (Math.ceil) and downwards (Math.floor)
>>
>> https://tid.li/tw5/plugins.html#rpn%20%E2%80%93%20Basic%20Math%20in%20Reverse%20Polish%20Notation
>>
>> Have fun!
>> Thomas
>>
>> Am Sonntag, 2. Juli 2017 21:20:48 UTC+2 schrieb Saq Imtiaz:
>>>
>>> This is neat. The lack of any kind of ability to do basic arithmetic is 
>>> the biggest hindrance I've had so far in TW5. I rolled my own solution but 
>>> it is not without its own shortcomings.
>>>
>>> You can probably add support for % (modulus) without too much trouble. 
>>> Will give this a go next time I have the time to fiddle with my TW5 
>>> project. Bookmarked.
>>>
>>> Saq
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/aa283d66-202d-4640-a993-f329ecf6e0b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to