From: oetiker Date: Sat, 15 Mar 2008 10:32:10 +0000 (+0000) Subject: reat nan as FALSE in an IF CDEF X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a85fb47867faf9b46dfc9858af5b3b608e87ab49;p=rrdtool-all.git reat nan as FALSE in an IF CDEF git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1305 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_rpncalc.c b/program/src/rrd_rpncalc.c index 839643b0..1f86f2eb 100644 --- a/program/src/rrd_rpncalc.c +++ b/program/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;