summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ebb9e5)
raw | patch | inline | side by side (parent: 2ebb9e5)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 15 Mar 2008 10:32:10 +0000 (10:32 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 15 Mar 2008 10:32:10 +0000 (10:32 +0000) |
src/rrd_rpncalc.c | patch | blob | history |
diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c
index 839643b0075101429fe4171b9297f0d3867d11d0..1f86f2eb02fc50c93f284a806981bb996ca13a0a 100644 (file)
--- a/src/rrd_rpncalc.c
+++ b/src/rrd_rpncalc.c
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;