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:
parent
71d0773c8d
commit
34921e983e
1
util.cpp
1
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; }
|
||||
|
Loading…
Reference in New Issue
Block a user