I am also confused as to what precision and what accuracy mean for bignum and why in incrementing an integer (for example, in the loop) precision discards useful digits to replace them with zeros
When you specify p => 1 you're actually saying that you want the values rounded to the nearest multiple of 10.
To have the values rounded to the nearest multiple of 100, specify p => 2. For rounding to the nearest multiple of 1000, specify p => 3, and so on.
So, with p => 1, 10 + 1 == 10 and 10 + 6 == 20, because 11 rounded to the nearest multiple of 10, is 10 and 16 rounded to the nearest multiple of 10 is 20.
OTOH, a => 1 indicates that you want the value rounded to a value that comprises a single digit multiplied by a power of 10, a => 2 indicates that the value should be rounded to a double-digit value multiplied by a power of 10.
It seems to me that "accuracy" would be better named "precision". (The trailing zeroes are just the exponent - it's the number of leading digits ahead of the exponent that determines the precision of the value.)
Not sure what "precision" should be renamed to .... "accuracy" ?
I think negative values for "p" just tell you how many decimal places you want after the decimal point.
With practice and experience it's probably useful - if you keep your wits about you. (I have not tested this - the reliance on "wits" deters me.)