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)
505
505
506
506
bool MathLib::isInt (const std::string & s)
507
507
{
508
- return isDec (s) || isHex (s) || isOct (s);
508
+ return isDec (s) || isHex (s) || isOct (s) || isBin (s) ;
509
509
}
510
510
511
511
std::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 {
274
274
275
275
ASSERT_EQUALS (true , MathLib::isInt (" 0xff" ));
276
276
ASSERT_EQUALS (true , MathLib::isInt (" 0xa" ));
277
+ ASSERT_EQUALS (true , MathLib::isInt (" 0b1000" ));
278
+ ASSERT_EQUALS (true , MathLib::isInt (" 0B1000" ));
277
279
ASSERT_EQUALS (true , MathLib::isInt (" 0l" ));
278
280
ASSERT_EQUALS (true , MathLib::isInt (" 0L" ));
279
281
ASSERT_EQUALS (true , MathLib::isInt (" 0ul" ));
You can’t perform that action at this time.
0 commit comments