Re: better return type for usqrt() in factor(6)

2016-09-01 Thread Otto Moerbeek
On Thu, Sep 01, 2016 at 06:36:15AM +0100, Theo Buehler wrote: > In factor(6), there is the line > > 216 stop = usqrt(val) + 1; > > where the u_int64_t stop is the upper bound for the sieve of > Eratosthenes (I cautiously added 1 to be sure to be on the safe side). > Unfortunately, the

Re: better return type for usqrt() in factor(6)

2016-09-01 Thread Tom Cosgrove
ok tom@ >>> Theo Buehler 1-Sep-16 06:36 >>> > > In factor(6), there is the line > > 216 stop = usqrt(val) + 1; > > where the u_int64_t stop is the upper bound for the sieve of > Eratosthenes (I cautiously added 1 to be sure to be on the safe side). > Unfortunately, the right hand side ma

Re: better return type for usqrt() in factor(6)

2016-09-01 Thread Philip Guenther
On Thu, Sep 1, 2016 at 6:36 AM, Theo Buehler wrote: > In factor(6), there is the line > > 216 stop = usqrt(val) + 1; > > where the u_int64_t stop is the upper bound for the sieve of > Eratosthenes (I cautiously added 1 to be sure to be on the safe side). > Unfortunately, the right hand

better return type for usqrt() in factor(6)

2016-08-31 Thread Theo Buehler
In factor(6), there is the line 216 stop = usqrt(val) + 1; where the u_int64_t stop is the upper bound for the sieve of Eratosthenes (I cautiously added 1 to be sure to be on the safe side). Unfortunately, the right hand side may now overflow for large enough val because my brilliant