[rrd-users] Re: Plot a dotted line
Alex van den Bogaerdt
alex at ergens.op.het.net
Tue Nov 22 16:19:51 MET 2005
On Tue, Nov 22, 2005 at 04:03:51PM +0100, Simone Morandini wrote:
> >"TIME,3600,one,*,/,2,%" should result in either 0 or 1.
> >
> As you say, it should, but it doesn't: I tryed
rrd_rpncalc.c:
case OP_MOD:
stackunderflow(1);
rpnstack -> s[stptr-1]= fmod( rpnstack -> s[stptr-1]
,rpnstack -> s[stptr]);
stptr--;
break;
man fmod:
The fmod() function computes the remainder of dividing x by y.
The return value is x - n * y, where n is the quotient of x / y,
rounded towards zero to an integer.
So indeed you end up with a float. Sorry for the confusion. This seems to
be intended behaviour. Only "y" is rounded to an integer, not the result.
> So, comparing this result with a number between 0 and 2 determines the
> length of the segments in the line.
Which is probably a nice feature in itself :)
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list