(p1 = numerator precision, p2 = denominator precision, pR = result precision; equivalent s for scale)-- min() ensures pR is no greater than 38 as mentioned in the note -- in our example, it becomes 38pR = min(p1-s1+s2+max(6,s1+p2+1),38)-- by subtracting from pR and using max(), we ensure a minimum of 6 digits to the right -- in our example this becomes max(38-(38-10+10),6) = max(0,6) = 6!sR = max(pR-(p1-s1+s2),6)