From 34921e983ecd9e80cf3259bc468d5b028848845e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 23 Sep 2018 02:33:37 +0200 Subject: [PATCH] fixed unary minus in number parser --- util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/util.cpp b/util.cpp index dcbd00a7..772723ca 100644 --- a/util.cpp +++ b/util.cpp @@ -184,6 +184,7 @@ struct exp_parser { } if(number == "e") res = exp(1); else if(number == "p" || number == "pi") res = M_PI; + else if(number == "" && next() == '-') res = 0, prio = 0; else if(number == "") at = -1; else if(number[0] >= 'a' && number[0] <= 'z') at = -1; else { std::stringstream ss; res = 0; ss << number; ss >> res; }