Edwin Nadorp wrote:
> I calculate the diverence by a - b = c
> But when b is greater then a the result is an negative number. I dont
> like that.
>
> So my question:
>
> How can i calculate the line by the folowing function : abs(a - b) =
> c ??
You want to have
c == a - b for a>b
and c == b - a in other cases
CDEF:c=a,b,GT,a,b,-,b,a,-,IF
Alternatively, you can do:
c == a - b; if (c<0) c=c*-1 else c=c*1;
CDEF:c=a,b,-,DUP,0,LT,-1,1,IF,*
this does: calculate a-b; duplicate; use the duplicate to check
against being less than zero; multiply with -1 if so, with 1 if not.
These examples do not check for being the INF, -INF or UNKN value.
cheers,
--
__________________________________________________________________
/ [EMAIL PROTECTED] [EMAIL PROTECTED] \
| work private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. |
+----------------------------------------------------------------------+
| http://faq.mrtg.org/ |
| http://rrdtool.eu.org --> tutorial |
+----------------------------------------------------------------------+
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi