[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making 'eq' == 'eql' in bignum branch
From: |
Lars Ingebrigtsen |
Subject: |
Re: Making 'eq' == 'eql' in bignum branch |
Date: |
Wed, 22 Aug 2018 10:26:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Slightly off-topic, but I thought it was amusing:
I was reading a blog post on C over/underruns, and I got to this bit:
Note that there is no value than can hold 2147483648, so if you
negate (int)0x80000000, you get (int)0x80000000 again. That is
something to look out for, because it means abs() returns a
negative value when fed -2147483648.
I didn't know that, and indeed in Emacs until a few weeks ago:
(abs most-negative-fixnum) => -2305843009213693952
Now, of course, with bignum support, we get a more correct result:
(abs most-negative-fixnum) => 2305843009213693952
(bignump (abs most-negative-fixnum)) => t
So now we don't have to fix the documentation of `abs':
---
abs is a built-in function in ‘C source code’.
(abs ARG)
Return the absolute value of ARG.
---
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: Making 'eq' == 'eql' in bignum branch, (continued)
- Re: Making 'eq' == 'eql' in bignum branch, Andy Moreton, 2018/08/20
- Re: Making 'eq' == 'eql' in bignum branch, Richard Stallman, 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, Eli Zaretskii, 2018/08/20
- 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, Robert Pluim, 2018/08/21
- Re: Making 'eq' == 'eql' in bignum branch, Robert Pluim, 2018/08/21
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/21
- Re: Making 'eq' == 'eql' in bignum branch,
Lars Ingebrigtsen <=
- Re: Making 'eq' == 'eql' in bignum branch, Herring, Davis, 2018/08/22
- Re: Making 'eq' == 'eql' in bignum branch, Lars Ingebrigtsen, 2018/08/22
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/22
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/22
- Re: Making 'eq' == 'eql' in bignum branch, Robert Pluim, 2018/08/23
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/08/23
- Re: Making 'eq' == 'eql' in bignum branch, Robert Pluim, 2018/08/23
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/23
- Re: Making 'eq' == 'eql' in bignum branch, Robert Pluim, 2018/08/24
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/25