From d7be1cb13eb46f173d994d2f9d71b70e89087f1f Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 15 Mar 2008 10:32:10 +0000 Subject: [PATCH] reat nan as FALSE in an IF CDEF git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1305 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_rpncalc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index 839643b..1f86f2e 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -705,8 +705,8 @@ short rpn_calc( break; case OP_IF: stackunderflow(2); - rpnstack->s[stptr - 2] = rpnstack->s[stptr - 2] != 0.0 ? - rpnstack->s[stptr - 1] : rpnstack->s[stptr]; + rpnstack->s[stptr - 2] = ( isnan(rpnstack->s[stptr - 2]) || rpnstack->s[stptr - 2] == 0.0 ) ? + rpnstack->s[stptr] : rpnstack->s[stptr - 1]; stptr--; stptr--; break; -- 2.30.2