| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func extractDigit() int64 { |
| if big.CmpInt(numer, accum) > 0 { |
| tmp1.Lsh(numer, 1).Add(tmp1, numer).Add(tmp1, accum) |
| big.DivModInt(tmp1, tmp2, tmp1, denom) |
| if big.CmpInt(tmp2, denom) >= 0 { |
| accum.Add(accum, tmp1.Lsh(numer, 1)) |
| accum.Mul(accum, tmp1.SetInt64(y2)) |
| numer.Mul(numer, tmp1.SetInt64(k)) |
| denom.Mul(denom, tmp1.SetInt64(y2)) |
| func eliminateDigit(d int64) { |
| accum.Sub(accum, tmp1.Mul(denom, tmp1.SetInt64(d))) |
| fmt.Printf("\n%d calls; bit sizes: %d %d %d\n", runtime.NumCgoCall(), numer.Len(), accum.Len(), denom.Len()) |