add_op(OP_UNKN,UNKN)
add_op(OP_UN,UN)
add_op(OP_NEGINF,NEGINF)
+ add_op(OP_NE,NE)
add_op(OP_PREV,PREV)
add_op(OP_INF,INF)
+ add_op(OP_ISINF,ISINF)
add_op(OP_NOW,NOW)
add_op(OP_LTIME,LTIME)
add_op(OP_TIME,TIME)
match_op(OP_UNKN,UNKN)
match_op(OP_UN,UN)
match_op(OP_NEGINF,NEGINF)
+ match_op(OP_NE,NE)
match_op(OP_PREV,PREV)
match_op(OP_INF,INF)
+ match_op(OP_ISINF,ISINF)
match_op(OP_NOW,NOW)
match_op(OP_LTIME,LTIME)
match_op(OP_TIME,TIME)
rpnstack -> s[stptr-1] = rpnstack -> s[stptr-1] >= rpnstack -> s[stptr] ? 1.0 : 0.0;
stptr--;
break;
+ case OP_NE:
+ if(stptr<1){
+ rrd_set_error("RPN stack underflow");
+ return -1;
+ }
+ if (isnan(rpnstack -> s[stptr-1]))
+ ;
+ else if (isnan(rpnstack -> s[stptr]))
+ rpnstack -> s[stptr-1] = rpnstack -> s[stptr];
+ else
+ rpnstack -> s[stptr-1] = rpnstack -> s[stptr-1] == rpnstack -> s[stptr] ? 0.0 : 1.0;
+ stptr--;
+ break;
case OP_EQ:
if(stptr<1){
rrd_set_error("RPN stack underflow");
}
rpnstack->s[stptr] = isnan(rpnstack->s[stptr]) ? 1.0 : 0.0;
break;
+ case OP_ISINF:
+ if(stptr<0){
+ rrd_set_error("RPN stack underflow");
+ return -1;
+ }
+ rpnstack->s[stptr] = isinf(rpnstack->s[stptr]) ? 1.0 : 0.0;
+ break;
case OP_END:
- break;
+ break;
}
}
if(stptr!=0){
OP_DIV,OP_SIN, OP_DUP, OP_EXC, OP_POP,
OP_COS,OP_LOG,OP_EXP,OP_LT,OP_LE,OP_GT,OP_GE,OP_EQ,OP_IF,
OP_MIN,OP_MAX,OP_LIMIT, OP_FLOOR, OP_CEIL,
- OP_UN,OP_END,OP_LTIME};
+ OP_UN,OP_END,OP_LTIME,OP_NE,OP_ISINF};
typedef struct rpnp_t {
enum op_en op;