Lines Matching refs:table
28 // TODO(gri) replace this with a table, generated at build time.
307 // construct table of successive squares of bb*leafSize to use in subdivisions
308 // result (table != nil) <=> (len(x) > leafSize > 0)
309 table := divisors(len(x), b, ndigits, bb)
315 q.convertWords(s, b, ndigits, bb, table)
350 func (q nat) convertWords(s []byte, b Word, ndigits int, bb Word, table []divisor) {
352 if table != nil {
355 index := len(table) - 1
360 for index > 0 && table[index-1].nbits > minLength {
363 if table[index].nbits >= maxLength && table[index].bbb.cmp(q) >= 0 {
371 q, r = q.div(r, q, table[index].bbb)
374 h := len(s) - table[index].ndigits
375 r.convertWords(s[h:], b, ndigits, bb, table[0:index])
376 s = s[:h] // == q.convertWords(s, b, ndigits, bb, table[0:index+1])
431 table [64]divisor // cached divisors for base 10
439 // construct table of powers of bb*leafSize to use in subdivisions
441 // only compute table when recursive conversion is enabled and x is large
448 for words := leafSize; words < m>>1 && k < len(cacheBase10.table); words <<= 1 {
452 // reuse and extend existing table of divisors or create new table as appropriate
453 var table []divisor // for b == 10, table overlaps with cacheBase10.table
456 table = cacheBase10.table[0:k] // reuse old table for this conversion
458 table = make([]divisor, k) // create new table for this conversion
461 // extend table
462 if table[k-1].ndigits == 0 {
466 if table[i].ndigits == 0 {
468 table[0].bbb = nat(nil).expWW(bb, Word(leafSize))
469 table[0].ndigits = ndigits * leafSize
471 table[i].bbb = nat(nil).mul(table[i-1].bbb, table[i-1].bbb)
472 table[i].ndigits = 2 * table[i-1].ndigits
476 larger = nat(nil).set(table[i].bbb)
478 table[i].bbb = table[i].bbb.set(larger)
479 table[i].ndigits++
482 table[i].nbits = table[i].bbb.bitLen()
491 return table