diff options
Diffstat (limited to 'src/lib/math/mp/mp_misc.cpp')
-rw-r--r-- | src/lib/math/mp/mp_misc.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/math/mp/mp_misc.cpp b/src/lib/math/mp/mp_misc.cpp index 4f24765bb..3b8be177e 100644 --- a/src/lib/math/mp/mp_misc.cpp +++ b/src/lib/math/mp/mp_misc.cpp @@ -43,6 +43,9 @@ s32bit bigint_cmp(const word x[], size_t x_size, */ word bigint_divop(word n1, word n0, word d) { + if(d == 0) + throw std::runtime_error("bigint_divop divide by zero"); + word high = n1 % d, quotient = 0; for(size_t i = 0; i != MP_WORD_BITS; ++i) |