call the method d.quantize with 3 arguments: exp, ROUND_HALF_UP and instance of Context class created with prec as prec,
sign , digits , exponent = d . quantize ( exp , ROUND_HALF_UP , Context ( prec = prec ) ) . as_tuple ( )