如果a和b其中有一个大于模p或者都大于模p,先将a或b减去p,直到a和b都小于模p为止,a1=(a-p)
2、减法首先,判断a、b这两个大数是否小于模p。如果a和b都小于模p,则:若a[i] > b[i],则 r = a[i] - b[i];若a[i] < b[i],则 r = a[i] - b[i] + p[i]如果a和b其中有一个大于模p或者都大于模p,先将a或b减去p,直到a和b都小于模p为止,a1=(a-p)
若a1[i] > b1[i],则 r = a1[i] – b1[i];若a1[i] < b1[i],则 r = a1[i] – b1[i] + p[i] 注:并且存在加法就会有进位,存在减法就会有借位。a b < p若 a+b>p 则 r = a+b-p;若a+b 则 r = a+b; a b > p先a1 = (a-p) 则:r = a1 + b1; a b < p若a>b r=a-b若a a b > p先a1=(a-p) 若a1>b1 r=a-b若a1