[rrd-developers] ROL and ROR for RPN

Steve Shipway s.shipway at auckland.ac.nz
Mon Apr 28 11:27:28 CEST 2014

In that case, maybe just call it ROTATE.  This would give the maximum flexibility..

x1, x2 .... xn, n, steps, ROTATE
n > 0
0 < abs(steps) < n

I'm trying to think of an efficient way to do this that doesn't involve a malloc (it's easy if you can malloc(n*sizeof(double*)) ).  Will have a go when I'm in the office tomorrow.

However should we keep ROL and ROR as shorthand for the more common 3,1,ROTATE and 3,-1,ROTATE ?


Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

From: Tobias Oetiker [tobi at oetiker.ch]
Sent: Monday, 28 April 2014 6:30 p.m.
To: Steve Shipway
Cc: rrd-developers at lists.oetiker.ch
Subject: Re: [rrd-developers] ROL and ROR for RPN

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?


More information about the rrd-developers mailing list