[rrd-developers] NAN-safe ADD

Tobias Oetiker tobi at oetiker.ch
Thu Mar 6 06:48:32 CET 2008


Hi Timo,

> On Thu, Mar 06, 2008 at 01:44:30AM +0100, Timo Stripf wrote:
> > Hello,
> >
> > i've implemented a nan-safe add operator (ADDNAN) into rrd. I used it
> > to add several incomplete graphs.
> >
> > NaN + NaN => NaN
> >  x + NaN => x
> >  NaN + y => y
> >  x + y => x + y
> [...]
> Quite often 'NaN' does not mean 'nothing'.  In many cases substituting
> the average of the two neighbours (not direct neighbours per se) would
> make more sense.
>
> At the very least I think this feature deserves more documentation than
> just a line or two.

How about doing this explicitly:

  x=a,UN,0,a,IF,b,UN,0,b,IF,+

then the effort for doing it has some relationship to the 'danger'
of the operation.

or if you insist to make this simpler, how about implementing a
NANTOZERO operator ?

 x=a,NANTOZERO,b,NANTOZERO,+

cheers
tobi

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902



More information about the rrd-developers mailing list