Fixed #6280 (MathLib: binary literals are integers)

This commit is contained in:
Robert Reif 2014-11-19 06:43:52 +01:00 committed by Daniel Marjamäki
parent 1c191845fb
commit b7c9187539
2 changed files with 3 additions and 1 deletions

View File

@ -505,7 +505,7 @@ bool MathLib::isDec(const std::string & s)
bool MathLib::isInt(const std::string & s)
{
return isDec(s) || isHex(s) || isOct(s);
return isDec(s) || isHex(s) || isOct(s) || isBin(s);
}
std::string MathLib::add(const std::string & first, const std::string & second)

View File

@ -274,6 +274,8 @@ private:
ASSERT_EQUALS(true , MathLib::isInt("0xff"));
ASSERT_EQUALS(true , MathLib::isInt("0xa"));
ASSERT_EQUALS(true , MathLib::isInt("0b1000"));
ASSERT_EQUALS(true , MathLib::isInt("0B1000"));
ASSERT_EQUALS(true , MathLib::isInt("0l"));
ASSERT_EQUALS(true , MathLib::isInt("0L"));
ASSERT_EQUALS(true , MathLib::isInt("0ul"));