MathLib(isInt): formatted and get rid of tabs.

No functional change.
This commit is contained in:
Slava Semushin 2009-08-17 00:43:45 +07:00
parent 8659c4828c
commit 32c8ba526b
1 changed files with 12 additions and 3 deletions

View File

@ -90,9 +90,18 @@ bool MathLib::isInt(const std::string & s)
while (isspace(s[n])) ++n; while (isspace(s[n])) ++n;
// determine type // determine type
if (s.find("E", 0) != std::string::npos) Mode = eScientific; if (s.find("E", 0) != std::string::npos)
else if (s.find("0x", n, 2) != std::string::npos) Mode = eHex; {
else if (s.find("0", n, 1) != std::string::npos && isdigit(s[n+1])) Mode = eOctal; Mode = eScientific;
}
else if (s.find("0x", n, 2) != std::string::npos)
{
Mode = eHex;
}
else if (s.find("0", n, 1) != std::string::npos && isdigit(s[n+1]))
{
Mode = eOctal;
}
// check sign // check sign
if (s[n] == '-' || s[n] == '+') ++n; if (s[n] == '-' || s[n] == '+') ++n;