[rrd-users] Subtraction and NaN values

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Feb 20 12:17:57 CET 2008


On Tue, Feb 19, 2008 at 01:35:37PM -0300, Eduardo Bragatto wrote:


> CDEF:memBuffer=UNKN,DSmemBuffer,EQ,DSmemBuffer,0,IF
> 
> I was expecting memBuffer to have 0 or the value from DSmemBuffer if  
> it's not NaN.
> 
> Does anybody knows what I'm doing wrong?

First of all you are trying to get either 0 or NaN out of it:

Your CDEF means: if (Nan == DSmemBuffer) then DSmemBuffer else 0

But reversing the two possible results won't work either.  You are
using "EQ" and "UNKN" (NaN) together.  Nothing is equal, not even
another NaN.

Try  CDEF:memBuffer=DSmemBuffer,UN,0,DSmemBuffer,IF
which means: if isnan(DSmemBuffer) then 0 else DSmemBuffer

-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list