Normalization of a multiple-precision number
normalize( a ) mp a; {int cy, i, la; la = length(a); start: cy = 0; for ( i=1; i
0) { a[i++] = cy%BASE; cy /= BASE;} if (cy<0) { a[la-1] += cy*BASE; for (i=1; i
2) i--; storelength( a, i ); if ( i==2 && a[1]==0 ) storesign( a, POS ); };
C
source (61.normal.c)
©
Addison-Wesley
Publishing Co. Inc.