[rrd-developers] ROL and ROR for RPN

Steve Shipway s.shipway at auckland.ac.nz
Mon Apr 28 02:37:06 CEST 2014


So, splitting this idea out from the separate post on the predict function,
I propose adding the new operations ROL and ROR to the RPN interpreter.

They would rotate the top 3 items left or right, and have this effect on the
stack ...

1,2,3,ROL  -->  2,3,1
1,2,3,ROR -->  3,1,2

These allow more complex arithmetic to be performed and complement the
existing EXC operator.

A context-diff against 1.4 is attached for your consideration; it is pretty
simple and implemented similarly to EXC.  The modified files are
rrd_rpncalc.h and rrd_rpncalc.c

Steve

Steve Shipway
s.shipway at auckland.ac.nz


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rol-ror.patch
Type: application/octet-stream
Size: 2386 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20140428/00c6dd8e/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5909 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20140428/00c6dd8e/attachment-0001.bin 


More information about the rrd-developers mailing list