Math-Prime-Util icon indicating copy to clipboard operation
Math-Prime-Util copied to clipboard

Possibly misleading error message

Open hvds opened this issue 4 years ago • 1 comments

In XS.xs:_validate_int() I see:

  if (len == 0 || ptr == 0)  croak("Parameter must be a positive integer");
  if (ptr[0] == '-' && negok) {
    isneg = 1; ptr++; len--;           /* Read negative sign */

It looks like the message should be negok ? "Parameter must be an integer" : "Parameter must be a positive integer".

hvds avatar Jun 04 '21 14:06 hvds

It looks like that was fixed in February in github, with the same behavior. Those changes also tried to consistently use "non-negative" rather than "positive" unless zero is not allowed.

danaj avatar Jun 05 '21 10:06 danaj