all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Bit shift oddity?
Date: Mon, 19 Oct 2020 11:01:59 +0200	[thread overview]
Message-ID: <20201019090159.GA11667@tuxteam.de> (raw)
In-Reply-To: <3b4def4b-28c5-d549-0645-0056f0709549@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On Mon, Oct 19, 2020 at 03:48:01AM -0400, Douglas Lewan wrote:
> Thanks. I see the same behavior with (ash).

Well, it's not exactly the "same behaviour", the inequalities
seem to be the same, but the intermediate numbers are not.

FWIW:

  (dotimes (i 10)
    (let ((shift (- -1 i)))
      (insert (format "shift=%d res=%d\n"
                      shift
                      (ash shift (lognot 0))))))
  =>

  shift=-1 res=-1
  shift=-2 res=-1
  shift=-3 res=-2
  shift=-4 res=-2
  shift=-5 res=-3
  shift=-6 res=-3
  shift=-7 res=-4
  shift=-8 res=-4
  shift=-9 res=-5
  shift=-10 res=-5
  
I don't quite understand the result; I may look into it later.

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2020-10-19  9:01 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
2020-10-19  9:01     ` tomas [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201019090159.GA11667@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.