summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-04 15:44:16 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-04 15:44:16 +0200
commit98f813a8e4005e97d523e76496d9e5bc7771eac5 (patch)
tree18d1784852c8efbc5311ea9650f6b25e0ab757ca
parentd8d18bdfd8b7dff26ea2af7d57b36f435710384b (diff)
Small bugfix
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 2cf77af..7fd05ad 100644
--- a/main.go
+++ b/main.go
@@ -17,12 +17,13 @@ import (
)
func seed(N *big.Int) (<-chan *big.Int, <-chan *big.Int) {
- // we start with sqrt(N)
+ // begin with floor(sqrt(N))
p := mathutil.SqrtBig(N)
p.SetBit(p, 0, 1) // ensure it's odd
+ // corelated value floor(N/q)
q := new(big.Int).Div(N, p)
- q.SetBit(p, 0, 1) // ensure it's odd
+ q.SetBit(q, 0, 1) // ensure it's odd
nxt := make(chan *big.Int)
go func(c chan *big.Int, n *big.Int) {