From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master ac1d15e95c 1/2: ; * src/data.c (Fash): More precise doc string
Date: Tue, 19 Jul 2022 19:46:24 +0200 [thread overview]
Message-ID: <4785DD4F-423E-498C-B18D-A5B104F38147@acm.org> (raw)
In-Reply-To: <83r12hm733.fsf@gnu.org>
19 juli 2022 kl. 17.54 skrev Eli Zaretskii <eliz@gnu.org>:
> The operation is "bit shift", so
> the most natural way of describing it is in terms of shifting bits.
> No?
Not necessarily. The user inputs numbers and gets a number out, not bit sequences, so it makes sense to describe the behaviour in arithmetic terms. (We're not describing a processor instruction that manipulates registers; `ash` is an operation on mathematical integers.)
A bitwise description would require knowledge of two's complement representation which you dismissed earlier. If it's acceptable to complement the arithmetic description with something that refers to such representation, then we could have:
If we view VALUE as a binary two's complement number, then shifting left introduce new 0-bits to the right and shifting right remove rightmost bits.
Since negative numbers have an infinite supply of 1-bits to the left, a negative number remains negative no matter how far it is shifted in either direction.
next prev parent reply other threads:[~2022-07-19 17:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 13:49 master ac1d15e95c 1/2: ; * src/data.c (Fash): More precise doc string Eli Zaretskii
2022-07-19 14:19 ` Mattias Engdegård
2022-07-19 14:26 ` Eli Zaretskii
2022-07-19 15:08 ` Mattias Engdegård
2022-07-19 15:54 ` Eli Zaretskii
2022-07-19 17:46 ` Mattias Engdegård [this message]
2022-07-19 19:04 ` Eli Zaretskii
2022-07-20 5:57 ` Richard Stallman
2022-07-19 16:29 ` Stefan Monnier
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=4785DD4F-423E-498C-B18D-A5B104F38147@acm.org \
--to=mattiase@acm.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@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.