(n, w)
| 155 | # Don't bother caching the "lo" mask in this; the time to compute it is |
| 156 | # tiny compared to the multiply. |
| 157 | def inner(n, w): |
| 158 | if w <= BITLIM: |
| 159 | return D(n) |
| 160 | w2 = w >> 1 |
| 161 | hi = n >> w2 |
| 162 | lo = n & ((1 << w2) - 1) |
| 163 | return inner(lo, w2) + inner(hi, w - w2) * w2pow[w2] |
| 164 | |
| 165 | with decimal.localcontext(_unbounded_dec_context): |
| 166 | nbits = n.bit_length() |
no test coverage detected
searching dependent graphs…