Bill Allombert on Thu, 14 Dec 2017 23:02:04 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: RFE: _==_ and friends should return a boolean


On Thu, Dec 14, 2017 at 04:39:36PM -0500, Sam Steingold wrote:
> > * Bill Allombert <Ovyy.Nyybzoreg@zngu.h-obeqrnhk.se> [2017-12-14 21:07:26 +0100]:
> >
> > On Thu, Dec 14, 2017 at 02:57:31PM -0500, Sam Steingold wrote:
> >> 
> >> pari.desc says:
> >> 
> >> --8<---------------cut here---------------start------------->8---
> >> Function: _==_
> >> Class: basic
> >> Section: symbolic_operators
> >> C-Name: geq
> >> Prototype: GG
> >> Help: _==_
> >> --8<---------------cut here---------------end--------------->8---
> >> 
> >> It would be nice if it returned a boolean (or at least a C int) rather
> >> than a GEN object.  I know the "Prototype" does not have a "b"
> >> character, but maybe you could add it?
> >
> > "geq" is a traditional GP wrapper around the C library function "gequal".
> > (Probably added before the prototype code system was implemented.)
> 
> Thanks, this answers the "why" question.
> 
> Now, what about changing geq to return an int? Is it possible?

It would become identical to gequal. What would be the point ?
Beside we cannot change the C API without good reason.

> How about adding "b" prototype?

b is already used for bitprec, and there are no boolean type in C89, so
we use i for int.

It seems to me you want to do something you are not communicating.

Cheers,
Bill.