From: Douglas Lewan <d.lewan2000@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Bit shift oddity?
Date: Mon, 19 Oct 2020 03:48:01 -0400 [thread overview]
Message-ID: <3b4def4b-28c5-d549-0645-0056f0709549@gmail.com> (raw)
In-Reply-To: <20201019070610.GB9024@tuxteam.de>
Thanks. I see the same behavior with (ash).
On 10/19/20 3:06 AM, tomas@tuxteam.de wrote:
> On Sun, Oct 18, 2020 at 08:19:24PM -0400, Douglas Lewan wrote:
>> I see the following:
>>
>> ELISP> (= (lsh -1 (lognot 0)) (lsh -2 (lognot 0)))
>>
>> t
>>
>> ELISP> (= (lsh -1 (lognot 0)) (lsh -3 (lognot 0)))
>>
>> nil
>>
>> The first seems odd to me. Is it really what's expected?
> The manual for lsh talks about "quirky behaviour" of lsh when
> both arguments are negative, in the name of backward-compatibility
> and suggests resorting to ash. Cf. the Emacs lisp manual "3.8
> Bitwise Operations on Integers"
>
> Cheers
> - t
--
,Doug
d.lewan2000@gmail.com
(908) 720 7908
You know, it's amazing how much closer to 0 that 8 067 332 is than 15 is. (2020 Oct 18)
next prev parent reply other threads:[~2020-10-19 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 0:19 Bit shift oddity? Douglas Lewan
2020-10-19 7:06 ` tomas
2020-10-19 7:48 ` Douglas Lewan [this message]
2020-10-19 9:01 ` tomas
2020-10-19 15:14 ` Stefan Monnier
2020-10-19 15:30 ` tomas
2020-10-19 9:23 ` Gregory Heytings via Users list for the GNU Emacs text editor
2020-10-19 15:19 ` Douglas Lewan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b4def4b-28c5-d549-0645-0056f0709549@gmail.com \
--to=d.lewan2000@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).