From 86447d4a40ba86a1c8961515c7f70bde3b7163e3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Jun 2015 14:00:48 +0200 Subject: [PATCH] bug fix: #2020 --- mix/QBigInt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mix/QBigInt.cpp b/mix/QBigInt.cpp index ee29cea43..7d7dd3857 100644 --- a/mix/QBigInt.cpp +++ b/mix/QBigInt.cpp @@ -65,7 +65,9 @@ QVariantMap QBigInt::checkAgainst(QString const& _type) const QString capacity = type.replace("uint", "").replace("int", ""); if (capacity.isEmpty()) capacity = "256"; - bigint range = 256^(capacity.toInt() / 8); + bigint range = 1; + for (int k = 0; k < capacity.toInt() / 8; ++k) + range = range * 256; bigint value = boost::get(this->internalValue()); ret.insert("valid", true); if (_type.startsWith("uint") && value > range - 1)