[OpenSIPS-Devel] [opensips] math_eval() does not handle negative numbers (#788)

rrb3942 notifications at github.com
Thu Feb 11 21:24:40 CET 2016


Attempting to use a negative number with math_eval in the mathops module results in a 'Mismatched tokens expression'

Example:
math_eval("10 + (-5)", "$var(test)");
Gives the following errors:
ERROR:mathops:pop_number: RPN Stack Empty
ERROR:mathops:pop_number: RPN Stack Empty
ERROR:mathops:evaluate_rpn_output: Parse expr error: stack has 0 elements
ERROR:mathops:evaluate_exp: Mismatched tokens in expression: <10 + (-5)>

Happens with or without the parentheses. 

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160211/24f3f02c/attachment-0001.htm>


More information about the Devel mailing list