GNU bug report logs - #43764
Calc shift right broken

Previous Next

Package: emacs;

Reported by: Vincent Belaïche <vincent.b.1 <at> hotmail.fr>

Date: Fri, 2 Oct 2020 15:29:02 UTC

Severity: normal

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 43764-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Vincent Belaïche <vincent.b.1 <at> hotmail.fr>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 43764-done <at> debbugs.gnu.org
Subject: Re: bug#43764: Calc shift right broken
Date: Tue, 13 Oct 2020 11:56:50 +0200
9 okt. 2020 kl. 17.34 skrev Vincent Belaïche <vincent.b.1 <at> hotmail.fr>:

> 	• set bit width 0 would remove the automatic clipping meaning infinite width.

The previously mentioned patch implementing this has now been pushed to Emacs master. Thanks again for the suggestion!

I should also note the rationale for disabling left/right rotation when the word size is set to zero: while it would make sense to define

 (rotate-left x 1) =>
 x≥0: (shift-left x 1)
 x<0: (+ (shift-left x 1) 1)

 (rotate-right x 1) =>
 x≥0, x even: (shift-right x 1)
 x<0, x odd:  (shift-right x 1),

the two remaining cases of rotate right with {x≥0, x odd} or {x<0, x even} cannot result in a finite integer.

If someone has a better idea, or would like rotation to be implemented as a partial function according to the above definition, please comment. For now the bug is closed.





This bug report was last modified 4 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.