unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: "Lars Ingebrigtsen" <larsi@gnus.org>,
	"Mattias Engdegård" <mattiase@acm.org>
Cc: "43764@debbugs.gnu.org" <43764@debbugs.gnu.org>
Subject: bug#43764: Calc shift right broken
Date: Fri, 9 Oct 2020 15:34:35 +0000	[thread overview]
Message-ID: <PR3PR06MB6843D55F5B94F69C50AA1F6284080@PR3PR06MB6843.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <87wo04nnvr.fsf@gnus.org>

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

Hello,
Sorry for the late feedback.

I think that it is good to have the possibility to set a bit width, just because otherwise the two complement signing display ('O d 6') would be broken, same for the leading zeros ('d z').


I agree that it is unwise to change anything in the way that it works. Changes should be backward compatible only, unless there is a very good reason for the change.

What could be improved would be to add some more functions, like (some ideas) :

  *   set bit width 0 would remove the automatic clipping meaning infinite width.
  *   have the H prefix (Hyperbolic) not only for 'b l' but also for the other shifts operation, so that the width can be set on an operation by operation basis with the prefix argument.
  *   Maybe there could be some display mode in which when integers are wider that the bit width this is displayed somehow, e.g. the pipe in 16#12|34 would appear with a bit width of 8, 16#123|4 for a bit width of 7. Just to warn the user « beware the clip ».

   Vincent.
________________________________
De : Lars Ingebrigtsen <larsi@gnus.org>
Envoyé : mardi 6 octobre 2020 03:28
À : Mattias Engdegård <mattiase@acm.org>
Cc : Vincent Belaïche <vincent.b.1@hotmail.fr>; 43764@debbugs.gnu.org <43764@debbugs.gnu.org>
Objet : Re: bug#43764: Calc shift right broken

Mattias Engdegård <mattiase@acm.org> writes:

>> But if we're changing the number of default bits, perhaps it would make
>> more sense to default to having no bit width restrictions?  Or would
>> that entail major Calc surgery?
>
> Any changes to Calc, however minor, are fraught with danger and excitement!

:-)

> Fun as it may be, better not making changes speculatively though.
> (On the other hand it could be that everyone have been bothered about
> this for years. I have no way of knowing.)

In olden times, I would guess most people thought that it just had to be
this way.  But now that the rest of Emacs has bignums, it's perhaps more
surprising that Calc behaves this way when doing shifts.

On the other hand, I don't know what people use Calc for here.  If
people are going "I wonder what would happen on a 32-bit machine if I
were to do this shift operation", then it'd be something else...

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

[-- Attachment #2: Type: text/html, Size: 4591 bytes --]

  parent reply	other threads:[~2020-10-09 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 15:28 bug#43764: Calc shift right broken Vincent Belaïche
2020-10-02 20:49 ` Mattias Engdegård
2020-10-05  8:12   ` Lars Ingebrigtsen
2020-10-05 10:34     ` Mattias Engdegård
2020-10-06  1:28       ` Lars Ingebrigtsen
2020-10-08 12:24         ` Mattias Engdegård
2020-10-09 15:29           ` Mattias Engdegård
2020-10-09 15:34         ` Vincent Belaïche [this message]
2020-10-10 16:24           ` Mattias Engdegård
2020-10-10 16:31             ` Mattias Engdegård
2020-10-13  9:56           ` Mattias Engdegård
2020-11-04 11:14             ` Vincent Belaïche
2020-11-04 11:54               ` Mattias Engdegård

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=PR3PR06MB6843D55F5B94F69C50AA1F6284080@PR3PR06MB6843.eurprd06.prod.outlook.com \
    --to=vincent.b.1@hotmail.fr \
    --cc=43764@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mattiase@acm.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 public inbox

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

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).