|
|
@ -458,8 +458,10 @@ void Op::init(const std::string& mstr, size_t maxBitSize, Mode mode) |
|
|
|
sq.set(mp); |
|
|
|
sq.set(mp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void arrayToStr(std::string& str, const Unit *x, size_t n, int base, bool withPrefix) |
|
|
|
void arrayToStr(std::string& str, const Unit *x, size_t n, int ioMode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
int base = ioMode & ~IoPrefix; |
|
|
|
|
|
|
|
bool withPrefix = ioMode & IoPrefix; |
|
|
|
switch (base) { |
|
|
|
switch (base) { |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
case 10: |
|
|
|
case 10: |
|
|
@ -592,7 +594,7 @@ uint64_t getUint64(bool *pb, const fp::Block& b) |
|
|
|
} |
|
|
|
} |
|
|
|
if (!pb) { |
|
|
|
if (!pb) { |
|
|
|
std::string str; |
|
|
|
std::string str; |
|
|
|
arrayToStr(str, b.p, b.n, 10, false); |
|
|
|
arrayToStr(str, b.p, b.n, 10); |
|
|
|
throw cybozu::Exception("fp::getUint64:large value") << str; |
|
|
|
throw cybozu::Exception("fp::getUint64:large value") << str; |
|
|
|
} |
|
|
|
} |
|
|
|
*pb = false; |
|
|
|
*pb = false; |
|
|
@ -631,7 +633,7 @@ int64_t getInt64(bool *pb, fp::Block& b, const fp::Op& op) |
|
|
|
} |
|
|
|
} |
|
|
|
if (!pb) { |
|
|
|
if (!pb) { |
|
|
|
std::string str; |
|
|
|
std::string str; |
|
|
|
arrayToStr(str, b.p, b.n, 10, false); |
|
|
|
arrayToStr(str, b.p, b.n, 10); |
|
|
|
throw cybozu::Exception("fp::getInt64:large value") << str << isNegative; |
|
|
|
throw cybozu::Exception("fp::getInt64:large value") << str << isNegative; |
|
|
|
} |
|
|
|
} |
|
|
|
*pb = false; |
|
|
|
*pb = false; |
|
|
|