Add an assert for num_bits function

This commit is contained in:
WO 2018-08-31 19:56:20 +09:00
parent ccb58e2cab
commit a7102acb7e
1 changed files with 1 additions and 0 deletions

View File

@ -124,6 +124,7 @@ size_t bigint<n>::num_bits() const
}
else
{
static_assert(GMP_NUMB_MAX <= ULLONG_MAX, "coercing limb to unsigned long long might truncate");
return ((i+1) * GMP_NUMB_BITS) - __builtin_clzll(x);
}
}