1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-22 23:17:04 +00:00

fixed unary minus in number parser

This commit is contained in:
Zeno Rogue 2018-09-23 02:33:37 +02:00
parent 71d0773c8d
commit 34921e983e

View File

@ -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; }