[rrd-developers] ROL and ROR for RPN

Tobias Oetiker tobi at oetiker.ch
Mon Apr 28 08:30:37 CEST 2014


Hi Steve,

your function always affects 3 values ... would there be any gain
in makeing this call more generic ?

a,b,c,d,x,y,ROL rotate the last x values on the stack by y steps to
the left. and maybe have -y role to the right?

cheers
tobi

Today Steve Shipway wrote:

> 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
>
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch tobi at oetiker.ch +41 62 775 9902



More information about the rrd-developers mailing list