I guess it is actually here that you get the OverflowError, because of the `prec1 *= 2`.