[rrd-developers] Correct implementation of IF

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Wed Jul 25 19:52:21 MEST 2001


Owen DeLong wrote:

> > I doubt that "IF" will do the right thing here.  The source for
> > 1.1.x doesn't seem to check for unknowns and even worse, it seems
> > to handle them as "true".  Better make sure and use then "UN"
> > statement here.
> > 
> He's right again. :-(

When in doubt, read the source :)

Anyway, I think that the IF function should only return the first
value if the condition is a finite value and if the condition != false.
So, both infinite and unknown values should be equivalent to false.

We have:  condition,a,b,IF and this works correctly for conditions
that are finite numbers.  Please review the table below and discuss
what would be the correct implementation.

condition | return value
----------+-------------
-infinite | -infinite or unknown or a or b ?
+infinite | +infinite or unknown or a or b ?
 unknown  |              unknown or a or b ?
 <0       | return a
==0       | return b
 >0       | return a

cheers,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| 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:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list