[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
1.0.
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];
CHECK_NUMBER_COERCE_MARKER (accum);
for (ptrdiff_t argnum = 1; argnum < nargs; argnum++)
{
Lisp_Object val = args[argnum];
CHECK_NUMBER_COERCE_MARKER (val);
if (!NILP (arithcompare (val, accum, comparison)))
accum = val;
else if (FLOATP (val) && isnan (XFLOAT_DATA (val)))
return val;
}
return accum;
}
Clément.
- Re: Making 'eq' == 'eql' in bignum branch, (continued)
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Pip Cet, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Herring, Davis, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Helmut Eller, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Pip Cet, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Elias Mårtenson, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Richard Stallman, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Johan Bockgård, 2018/08/30
- Re: Making 'eq' == 'eql' in bignum branch,
Clément Pit-Claudel <=
- Re: Making 'eq' == 'eql' in bignum branch, Tom Tromey, 2018/08/30
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/30
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/20
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/08/20
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/20
- Re: Making 'eq' == 'eql' in bignum branch, Helmut Eller, 2018/08/20
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/20