[Top][All Lists]

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

Re: Making 'eq' == 'eql' in bignum branch

From: Clément Pit-Claudel
Subject: Re: Making 'eq' == 'eql' in bignum branch
Date: Thu, 30 Aug 2018 17:14:25 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-08-30 15:13, Johan Bockgård wrote:
> Clément Pit-Claudel <address@hidden> writes:
>> On 2018-08-26 16:45, Richard Stallman wrote:
>>> How about if we make min and max accept, and ignore, nil as argument?
>> I usually use 1.0e+INF and -1.0e+INF when I need a neutral element for
>> min and max respectively, rather than most-positive-fixnum. Is there
>> anything wrong with that? If not, I think we don't even need to change
>> min and max at all.
> It doesn't preserve integerness; (min 1 NEUTRAL-ELEMENT) should be 1,
> but (min 1 1e+INF) is 1.0.

What platform are you on? On my machine (x86_64-pc-linux-gnu) it returns 1, not 

And, AFAICT, the implementation always returns one of its arguments:

static Lisp_Object
minmax_driver (ptrdiff_t nargs, Lisp_Object *args,
               enum Arith_Comparison comparison)
  Lisp_Object accum = args[0];
  for (ptrdiff_t argnum = 1; argnum < nargs; argnum++)
      Lisp_Object val = args[argnum];
      if (!NILP (arithcompare (val, accum, comparison)))
        accum = val;
      else if (FLOATP (val) && isnan (XFLOAT_DATA (val)))
        return val;
  return accum;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]