Subject: bug#43764: Calc shift right broken

From: Mattias Engdegård <[email-masked]>
Date: Sat, 10 Oct 2020 18:24:39 +0200

9 okt. 2020 kl. 17.34 skrev Vincent Belaïche <[email-masked]>:

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

This seems both useful and straightforward to implement and understand. I've attached a patch (lacking documentation but otherwise complete) -- is it what you had in mind?

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

Your wish has been granted! It already works that way, it's just not very well documented. Try it.

> 	• 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 ».

It's not a bad suggestion, but since this is Calc, nothing is very simple. Let's give it some thought.