Re: gmp 6.2.0 documentation bug

2020-10-02 Thread Hans Åberg


> On 29 Sep 2020, at 19:17, Marco Bodrato  wrote:
> 
> Il 2020-09-29 16:09 TonyMcC ha scritto:
>> I think there is a word (a function name?) missing from the
>> documentation for gmp 6.2.0.  In gmp.texi, at line 2541 it reads:
>> "it's probably best to call to get a starting point and iterate from there."
>> Should there be a function name after "call"?
> 
> The complete sentence is:
> 
> Functions like @code{mpz_fac_ui}, @code{mpz_fib_ui} and @code{mpz_bin_uiui}
> are designed for calculating isolated values.  If a range of values is wanted
> it's probably best to call to get a starting point and iterate from there.
> 
> Maybe we can simply remove "to call".
> 
> The documentation of mpz_fib_ui correctly suggests the function to call: 
> mpz_fib2_ui.
> 
> Speaking about mpz_fac_ui and mpz_bin_uiui, it shouldn't be necessary to 
> suggest how to get the starting point.

It might say:
  If a range of values is wanted, see the definition respective function.
Since it is properly described for first two. For the binomials, it would be 
most efficient to compute the trapezoid above the values in Pascal's triangle, 
I would think, and the function does not provide an efficient way to get that.


___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


gmp 6.2.0 documentation bug

2020-09-29 Thread TonyMcC

Hi,

I think there is a word (a function name?) missing from the 
documentation for gmp 6.2.0.  In gmp.texi, at line 2541 it reads:


"it's probably best to call to get a starting point and iterate from there."

Should there be a function name after "call"?

Best wishes,
Tony
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: gmp 6.2.0 documentation bug

2020-09-29 Thread Marco Bodrato

Ciao,

Il 2020-09-29 16:09 TonyMcC ha scritto:

I think there is a word (a function name?) missing from the
documentation for gmp 6.2.0.  In gmp.texi, at line 2541 it reads:

"it's probably best to call to get a starting point and iterate from 
there."


Should there be a function name after "call"?


The complete sentence is:

Functions like @code{mpz_fac_ui}, @code{mpz_fib_ui} and 
@code{mpz_bin_uiui}
are designed for calculating isolated values.  If a range of values is 
wanted
it's probably best to call to get a starting point and iterate from 
there.


Maybe we can simply remove "to call".

The documentation of mpz_fib_ui correctly suggests the function to call: 
mpz_fib2_ui.


Speaking about mpz_fac_ui and mpz_bin_uiui, it shouldn't be necessary to 
suggest how to get the starting point.


Ĝis,
m
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: gmp 6.2.0 documentation bug

2020-09-29 Thread Paul Zimmermann
   Hi Tony,

> I think there is a word (a function name?) missing from the 
> documentation for gmp 6.2.0.  In gmp.texi, at line 2541 it reads:
> 
> "it's probably best to call to get a starting point and iterate from there."
> 
> Should there be a function name after "call"?

yes, I guess you should read "it's probably best to call them to get a
starting point and iterate from there" where "them" refers to mpz_fac_ui,
mpz_fib_ui and mpz_bin_uiui.

Paul
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: note: documentation bug

2018-02-26 Thread Vincent Lefevre
Hi,

On 2018-02-25 20:37:49 +0100, Stéphane Bosio wrote:
> the following can be read:
> 
>-- Function: void mpz_rrandomb (mpz_t ROP, gmp_randstate_t STATE,
>   mp_bitcnt_t N)
>  Generate a random integer with long strings of zeros and ones in
>  the binary representation.  Useful for testing functions and
>  algorithms, since this kind of random numbers have proven to be
>  more likely to trigger corner-case bugs.  The random number
>will be
>  in the range 2^N-1 to 2^N-1, inclusive.
> 
> I'm pretty sure the intended range isn't 2^N-1 to 2^N-1, which is a single
> number, not a range and not random at all.

This is a rendering bug in the info format.
The first one should be 2^(N-1).

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


note: documentation bug

2018-02-26 Thread Stéphane Bosio

Hello,

I think there is an error in the following info section :

   * Random Number Functions::    Functions for generating random numbers.

then

   *note Integer Random Numbers::

the following can be read:

   -- Function: void mpz_rrandomb (mpz_t ROP, gmp_randstate_t STATE,
  mp_bitcnt_t N)
 Generate a random integer with long strings of zeros and ones in
 the binary representation.  Useful for testing functions and
 algorithms, since this kind of random numbers have proven to be
 more likely to trigger corner-case bugs.  The random number
   will be
 in the range 2^N-1 to 2^N-1, inclusive.

I'm pretty sure the intended range isn't 2^N-1 to 2^N-1, which is a 
single number, not a range and not random at all.


The range is probably -(2^N) to 2^N-1 as for usual signed integer types.

The only information relevant about GMP for this bug should be it's 
version which is 6.1.2.


I hope this helps. I apologize for my English, which is not my natural 
language.


S. BOSIO

___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


documentation bug

2017-06-06 Thread paul zimmermann
reported to me by Bob Baillie (through Sam Wagstaff):

>Anyway, on page 111 of the manual (section 15.7.1, Prime Testing)
>https://gmplib.org/gmp-man-6.1.2.pdf
>where it describes the algorithm for “mpz_probab_prime_p”, it says,
>
>"For an odd input n, and with n = q*2^k + 1 where q is odd, this algorithm
>selects a random base x and tests whether
>   x^q mod n is 1 or -1,
>or an
>   x^(q2^j) mod n is 1, for 1 <= j <= k.
>If so then n is probably prime, if not then n is definitely composite."
>
>It looks like they are trying to describe the strong probable prime test.
>However, in a strong probable prime test, the second check should be
>   x^(q2^j) mod n is -1, for 1 <= j < k.
>
>The manual is wrong, right? Do you know if the code is correctly written?

Paul Zimmermann
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs