Use C-style comments.

This commit is contained in:
Stefan Krah 2012-09-23 15:46:09 +02:00
parent 8f734ebe94
commit f817a7b178
1 changed files with 24 additions and 24 deletions

View File

@ -5063,28 +5063,28 @@ _karatsuba_rec(mpd_uint_t *c, const mpd_uint_t *a, const mpd_uint_t *b,
return; return;
} }
m = (la+1)/2; // ceil(la/2) m = (la+1)/2; /* ceil(la/2) */
/* lb <= m < la */ /* lb <= m < la */
if (lb <= m) { if (lb <= m) {
/* lb can now be larger than la-m */ /* lb can now be larger than la-m */
if (lb > la-m) { if (lb > la-m) {
lt = lb + lb + 1; // space needed for result array lt = lb + lb + 1; /* space needed for result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
_karatsuba_rec(w, b, a+m, w+lt, lb, la-m); // b*ah _karatsuba_rec(w, b, a+m, w+lt, lb, la-m); /* b*ah */
} }
else { else {
lt = (la-m) + (la-m) + 1; // space needed for result array lt = (la-m) + (la-m) + 1; /* space needed for result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
_karatsuba_rec(w, a+m, b, w+lt, la-m, lb); // ah*b _karatsuba_rec(w, a+m, b, w+lt, la-m, lb); /* ah*b */
} }
_mpd_baseaddto(c+m, w, (la-m)+lb); // add ah*b*B**m _mpd_baseaddto(c+m, w, (la-m)+lb); /* add ah*b*B**m */
lt = m + m + 1; // space needed for the result array lt = m + m + 1; /* space needed for the result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
_karatsuba_rec(w, a, b, w+lt, m, lb); // al*b _karatsuba_rec(w, a, b, w+lt, m, lb); /* al*b */
_mpd_baseaddto(c, w, m+lb); // add al*b _mpd_baseaddto(c, w, m+lb); /* add al*b */
return; return;
} }
@ -5360,34 +5360,34 @@ _karatsuba_rec_fnt(mpd_uint_t *c, const mpd_uint_t *a, const mpd_uint_t *b,
return 1; return 1;
} }
m = (la+1)/2; // ceil(la/2) m = (la+1)/2; /* ceil(la/2) */
/* lb <= m < la */ /* lb <= m < la */
if (lb <= m) { if (lb <= m) {
/* lb can now be larger than la-m */ /* lb can now be larger than la-m */
if (lb > la-m) { if (lb > la-m) {
lt = lb + lb + 1; // space needed for result array lt = lb + lb + 1; /* space needed for result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
if (!_karatsuba_rec_fnt(w, b, a+m, w+lt, lb, la-m)) { // b*ah if (!_karatsuba_rec_fnt(w, b, a+m, w+lt, lb, la-m)) { /* b*ah */
return 0; /* GCOV_UNLIKELY */ return 0; /* GCOV_UNLIKELY */
} }
} }
else { else {
lt = (la-m) + (la-m) + 1; // space needed for result array lt = (la-m) + (la-m) + 1; /* space needed for result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
if (!_karatsuba_rec_fnt(w, a+m, b, w+lt, la-m, lb)) { // ah*b if (!_karatsuba_rec_fnt(w, a+m, b, w+lt, la-m, lb)) { /* ah*b */
return 0; /* GCOV_UNLIKELY */ return 0; /* GCOV_UNLIKELY */
} }
} }
_mpd_baseaddto(c+m, w, (la-m)+lb); // add ah*b*B**m _mpd_baseaddto(c+m, w, (la-m)+lb); /* add ah*b*B**m */
lt = m + m + 1; // space needed for the result array lt = m + m + 1; /* space needed for the result array */
mpd_uint_zero(w, lt); // clear result array mpd_uint_zero(w, lt); /* clear result array */
if (!_karatsuba_rec_fnt(w, a, b, w+lt, m, lb)) { // al*b if (!_karatsuba_rec_fnt(w, a, b, w+lt, m, lb)) { /* al*b */
return 0; /* GCOV_UNLIKELY */ return 0; /* GCOV_UNLIKELY */
} }
_mpd_baseaddto(c, w, m+lb); // add al*b _mpd_baseaddto(c, w, m+lb); /* add al*b */
return 1; return 1;
} }