clipZeros

Trims any trailing zeros and returns the number of zeros trimmed.

int
clipZeros
(
ref BigInt n
,
uint digits
)

Examples

auto big = BigInt("123456789000000");
auto digits = countDigits(big);
assert(digits == 15);
auto zeros = clipZeros(big, digits);
assert(zeros == 6);

Meta