|
From: | Douglas Lewan |
Subject: | Re: Bit shift oddity? |
Date: | Mon, 19 Oct 2020 03:48:01 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
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)
[Prev in Thread] | Current Thread | [Next in Thread] |