Try to avoid compiler warning for unary minus operator inside MathLib::toLongNumber<biguint>()

This commit is contained in:
Alexander Mai 2014-04-13 19:20:44 +02:00
parent b4b340b7be
commit 1ef99e2662
1 changed files with 5 additions and 2 deletions

View File

@ -24,6 +24,7 @@
#include <cstdlib>
#include <string>
#include <sstream>
#include <type_traits>
#include "config.h"
/// @addtogroup Core
@ -69,8 +70,10 @@ public:
if (str[i] == '1')
ret |= 1;
}
if (str[0] == '-')
ret = -ret;
if (std::is_signed<T>()) {
if (str[0] == '-')
ret = -ret;
}
return ret;
}