File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -505,7 +505,7 @@ bool MathLib::isDec(const std::string & s)
505505
506506bool MathLib::isInt (const std::string & s)
507507{
508- return isDec (s) || isHex (s) || isOct (s);
508+ return isDec (s) || isHex (s) || isOct (s) || isBin (s) ;
509509}
510510
511511std::string MathLib::add (const std::string & first, const std::string & second)
Original file line number Diff line number Diff line change @@ -274,6 +274,8 @@ class TestMathLib : public TestFixture {
274274
275275 ASSERT_EQUALS (true , MathLib::isInt (" 0xff" ));
276276 ASSERT_EQUALS (true , MathLib::isInt (" 0xa" ));
277+ ASSERT_EQUALS (true , MathLib::isInt (" 0b1000" ));
278+ ASSERT_EQUALS (true , MathLib::isInt (" 0B1000" ));
277279 ASSERT_EQUALS (true , MathLib::isInt (" 0l" ));
278280 ASSERT_EQUALS (true , MathLib::isInt (" 0L" ));
279281 ASSERT_EQUALS (true , MathLib::isInt (" 0ul" ));
You can’t perform that action at this time.
0 commit comments