From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Bit shift oddity?
Date: Mon, 19 Oct 2020 09:06:10 +0200 [thread overview]
Message-ID: <20201019070610.GB9024@tuxteam.de> (raw)
In-Reply-To: <880f79e9-e2ea-b180-d83f-c3d47f5fb789@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2020-10-19 7:06 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 [this message]
2020-10-19 7:48 ` Douglas Lewan
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=20201019070610.GB9024@tuxteam.de \
--to=tomas@tuxteam.de \
--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).