Home | History | Annotate | Download | only in big

Lines Matching refs:table

30 // TODO(gri) replace this with a table, generated at build time.
318 // construct table of successive squares of bb*leafSize to use in subdivisions
319 // result (table != nil) <=> (len(x) > leafSize > 0)
320 table := divisors(len(x), b, ndigits, bb)
326 q.convertWords(s, b, ndigits, bb, table)
361 func (q nat) convertWords(s []byte, b Word, ndigits int, bb Word, table []divisor) {
363 if table != nil {
366 index := len(table) - 1
371 for index > 0 && table[index-1].nbits > minLength {
374 if table[index].nbits >= maxLength && table[index].bbb.cmp(q) >= 0 {
382 q, r = q.div(r, q, table[index].bbb)
385 h := len(s) - table[index].ndigits
386 r.convertWords(s[h:], b, ndigits, bb, table[0:index])
387 s = s[:h] // == q.convertWords(s, b, ndigits, bb, table[0:index+1])
442 table [64]divisor // cached divisors for base 10
450 // construct table of powers of bb*leafSize to use in subdivisions
452 // only compute table when recursive conversion is enabled and x is large
459 for words := leafSize; words < m>>1 && k < len(cacheBase10.table); words <<= 1 {
463 // reuse and extend existing table of divisors or create new table as appropriate
464 var table []divisor // for b == 10, table overlaps with cacheBase10.table
467 table = cacheBase10.table[0:k] // reuse old table for this conversion
469 table = make([]divisor, k) // create new table for this conversion
472 // extend table
473 if table[k-1].ndigits == 0 {
477 if table[i].ndigits == 0 {
479 table[0].bbb = nat(nil).expWW(bb, Word(leafSize))
480 table[0].ndigits = ndigits * leafSize
482 table[i].bbb = nat(nil).sqr(table[i-1].bbb)
483 table[i].ndigits = 2 * table[i-1].ndigits
487 larger = nat(nil).set(table[i].bbb)
489 table[i].bbb = table[i].bbb.set(larger)
490 table[i].ndigits++
493 table[i].nbits = table[i].bbb.bitLen()
502 return table