- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for DivModInt (0.04 sec)
-
misc/cgo/gmp/pi.go
denom = big.NewInt(1) ten = big.NewInt(10) ) func extractDigit() int64 { if big.CmpInt(numer, accum) > 0 { return -1 } tmp1.Lsh(numer, 1).Add(tmp1, numer).Add(tmp1, accum) big.DivModInt(tmp1, tmp2, tmp1, denom) tmp2.Add(tmp2, numer) if big.CmpInt(tmp2, denom) >= 0 { return -1 } return tmp1.Int64() } func nextTerm(k int64) { y2 := k*2 + 1 accum.Add(accum, tmp1.Lsh(numer, 1))
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Apr 10 22:32:35 UTC 2023 - 1.3K bytes - Viewed (0) -
misc/cgo/gmp/gmp.go
x.doinit() y.doinit() switch cmp := C.mpz_cmp(&x.i[0], &y.i[0]); { case cmp < 0: return -1 case cmp == 0: return 0 } return +1 } // DivModInt sets q = x / y and r = x % y. func DivModInt(q, r, x, y *Int) { q.doinit() r.doinit() x.doinit() y.doinit() C.mpz_tdiv_qr(&q.i[0], &r.i[0], &x.i[0], &y.i[0]) }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Apr 11 16:34:30 UTC 2022 - 9.5K bytes - Viewed (0)