diff --git a/lib/mathlib.h b/lib/mathlib.h index 233d601ba..bd4aacbd5 100644 --- a/lib/mathlib.h +++ b/lib/mathlib.h @@ -24,6 +24,7 @@ #include #include #include +#include #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()) { + if (str[0] == '-') + ret = -ret; + } return ret; }