GNU bug report logs - #15859
24.3.50; Calc - dimensionless units again

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <winkler <at> gnu.org>

Date: Sun, 10 Nov 2013 23:36:02 UTC

Severity: normal

Found in version 24.3.50

To reply to this bug, email your comments to 15859 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Sun, 10 Nov 2013 23:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Roland Winkler" <winkler <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 10 Nov 2013 23:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Calc - dimensionless units again
Date: Sun, 10 Nov 2013 17:35:21 -0600
I thought that the new (though undocumented) variable
calc-allow-units-as-numbers allowed to perform unit conversions
involving dimensionless units. Yet I am still having trouble with
this.  (For the following I have used the default
calc-allow-units-as-numbers bound to t, assuming that this is what I
need.)

Say, the old expression is "7 m / (c s)" and I want to convert this
into a physically equal expression.  So I run calc-convert-units,
which will ask

  (The expression is unitless when simplified) Old Units: 

With calc-allow-units-as-numbers non-nil, I think calc-convert-units
should not ask this question, or there should be some other way to
customize calc-convert-units to skip this question.  Anyway, I enter
an empty string, because I do not know what else would be meaningful
here. [m/(c s) is equal to 3.33e-9, this cannot be required if I
just want to convert "7 m / (c s)" into something equal to this
expression.]

Now for the new unit:

(1) If I want to convert "7 m / (c s)" to a plain number, I enter "1",
    but then Calc throws an error "No units specified".
    The correct result would be 2.33e-8.

(2) If one wants to convert to the new unit "in / (c hr)" the result
    returned by calc-convert-units is 2.33e-8, that is, the plain
    number which would have been the correct result for (1).
    The new unit "in / (c hr)" is ignored by calc-convert-units.
    The correct result would be "992125.98 in / (c hr)".

Both examples assume that it should be possible to make a unit
conversion where the old expression on the stack is physically equal
to the new expression.  I think this assumption is reasonable.




In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2013-11-10 on regnitz
Bzr revision: 115054 jan.h.d <at> swipnet.se-20131110121803-bv908hul7t8ji6c8
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.3 LTS




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Sun, 22 Nov 2020 15:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Sun, 22 Nov 2020 16:13:13 +0100
"Roland Winkler" <winkler <at> gnu.org> writes:

> Say, the old expression is "7 m / (c s)" and I want to convert this
> into a physically equal expression.  So I run calc-convert-units,
> which will ask
>
>   (The expression is unitless when simplified) Old Units:

Yes, I agree that the command doesn't behave in a useful way here.

u s works for me here and seems to do what you want.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Mon, 23 Nov 2020 15:14:01 GMT) Full text and rfc822 format available.

Message #11 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 23 Nov 2020 09:13:11 -0600
On Sun Nov 22 2020 Michael Heerdegen wrote:
> "Roland Winkler" <winkler <at> gnu.org> writes:
> 
> > Say, the old expression is "7 m / (c s)" and I want to convert this
> > into a physically equal expression.  So I run calc-convert-units,
> > which will ask
> >
> >   (The expression is unitless when simplified) Old Units:
> 
> Yes, I agree that the command doesn't behave in a useful way here.
> 
> u s works for me here and seems to do what you want.

Thanks for confirming that the current behavior is not useful.  Long
ago, before Calc was merged into the GNU Emacs trunk.  Calc was
handling dimensionless units just fine, which is why I consider the
new behavior a bad regression.  Personally, am so annoyed by this
behavior that I run into too often that I have gone back to a
version of calc-units.el from old times before Calc was merged into
the GNU Emacs trunk.  (For myself, none of the changes that were
done since then to calc-units.el are significant or useful.)
I really would like to revert the broken changes in calc-units.el
and bring the relevant pieces of code back to what they used to be.
But I have not yet found the time to come up with a patch for this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Tue, 24 Nov 2020 01:01:01 GMT) Full text and rfc822 format available.

Message #14 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: Jay Belanger <jay.p.belanger <at> gmail.com>, 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Tue, 24 Nov 2020 02:00:08 +0100
"Roland Winkler" <winkler <at> gnu.org> writes:

For your recipe that failed to convert 7 m / (c s) to a unitless
expression using u c, if I specify as old units "m 1/s 1/c" and as new
units "1", I get a result with u c, but it is different from the result
I get with u s.  I tried some other combinations of old units
(e.g. skipping 1/c) but that doesn't result in a unitless expression.

I'm CC'ing Jay B. who seems to have worked on that code 8 years ago.
Maybe he can hear us?


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Tue, 24 Nov 2020 23:38:02 GMT) Full text and rfc822 format available.

Message #17 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: Jay Belanger <jay.p.belanger <at> gmail.com>, 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Wed, 25 Nov 2020 00:37:39 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> I'm CC'ing Jay B. who seems to have worked on that code 8 years ago.
> Maybe he can hear us?

Maybe the tests whether the user specified any units are just too eager
in this case?  When I comment them out, I can input "1" or an empty
string two times and u c behaves as you want.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Mon, 06 Sep 2021 09:41:01 GMT) Full text and rfc822 format available.

Message #20 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Jay Belanger <jay.p.belanger <at> gmail.com>, Roland Winkler <winkler <at> gnu.org>,
 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 06 Sep 2021 11:40:46 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>
>> I'm CC'ing Jay B. who seems to have worked on that code 8 years ago.
>> Maybe he can hear us?
>
> Maybe the tests whether the user specified any units are just too eager
> in this case?  When I comment them out, I can input "1" or an empty
> string two times and u c behaves as you want.

Do you have a proposed patch for this?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Fri, 17 Sep 2021 01:46:02 GMT) Full text and rfc822 format available.

Message #23 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jay Belanger <jay.p.belanger <at> gmail.com>, Roland Winkler <winkler <at> gnu.org>,
 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Fri, 17 Sep 2021 03:45:02 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Do you have a proposed patch for this?

I don't, but maybe Roland is able to provide one?


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Fri, 14 Apr 2023 15:13:02 GMT) Full text and rfc822 format available.

Message #26 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Fri, 14 Apr 2023 17:12:32 +0200
"Roland Winkler" <winkler <at> gnu.org> writes:

> (2) If one wants to convert to the new unit "in / (c hr)" the result
>     returned by calc-convert-units is 2.33e-8, that is, the plain
>     number which would have been the correct result for (1).
>     The new unit "in / (c hr)" is ignored by calc-convert-units.
>     The correct result would be "992125.98 in / (c hr)".

I tried to follow what Calc is doing in this case using Edebug.
Everything seems to work as expected - it's only that Calc automatically
unit-simplifies the resulting expression, and that brings us to the
simpler unit-less form.  This happens here (I was using fraction mode
when recording this backtrace):

| 1 -> (math-simplify-units (* (frac 126000000 127) (/ (var in var-in) (* (var c var-c) (var hr var-hr))))) 16:55:53.949
|   (math-apply-units (/ (/ (* 7 (var m var-m)) (* (/ (* 299792458 (var m var-m)) (var s var-s)) (var s var-s))) (/ (* 254 (* (^ 10 -2) (* (^ 10 -2) (var m var-m)))) (* (/ (* 299792458 (var m var-m)) (var s var-s)) (* 60 (* 60 (var s var-s)))))) (/ (var in var-in) (* (var c var-c) (var hr var-hr))) nil nil)
|   (math-convert-units-rec (/ (* 7 (var m var-m)) (* (var c var-c) (var s var-s))))
|   (math-normalize (let ((calc-internal-prec (+ calc-internal-prec 2))) (let ((compat (and (not pure) (math-find-compatible-unit expr new-units))) (math-cu-unit-list nil) (math-combining-units nil)) (if compat (math-simplify-units (math-mul (math-mul (math-simplify-units ...) (math-pow new-units ...)) (math-simplify-units (math-to-standard-units ... nil)))) (if (setq math-cu-unit-list (math-decompose-units new-units)) (progn (setq new-units (nth 2 ...)))) (if (eq (car-safe expr) '+) (progn (setq expr (math-simplify-units expr)))) (if (math-units-in-expr-p expr t) (let ((math-cu-new-units new-units) (math-cu-pure pure)) (math-convert-units-rec expr)) (math-apply-units (math-to-standard-units (list ... expr new-units) nil) new-units math-cu-unit-list pure))))))
|   (math-convert-units (/ (* 7 (var m var-m)) (* (var c var-c) (var s var-s))) (/ (var in var-in) (* (var c var-c) (var hr var-hr))) nil)
|   (calc-do (closure ((new-units . "in / (c hr)") (old-units)) nil (let ((expr (calc-top-n 1)) (uoldname nil) (unitscancel nil) (nouold nil) units defunits) (if (or (not (math-units-in-expr-p expr t)) (setq unitscancel (and (if ... ... calc-allow-units-as-numbers) (eq ... 1)))) (let ((uold (or old-units ...))) (if (or calc-allow-units-as-numbers (math-units-in-expr-p uold t)) nil (error "No units specified")) (if (eq (car-safe uold) 'error) (progn (error "Bad format in units expression: %s" ...))) (setq expr (math-mul expr uold)))) (setq defunits (math-get-default-units expr)) (if new-units nil (setq new-units (read-string (format-prompt (if ... ... "New units") defunits))) (if (string= new-units "") (progn (setq new-units (or defunits "1"))))) (if (string-match "\\` */" new-units) (progn (setq new-units (concat "1" new-units)))) (setq units (math-read-expr new-units)) (if (eq (car-safe units) 'error) (progn (error "Bad format in units expression: %s" (nth 2 units)))) (if calc-ensure-consistent-units (math-check-unit-consistency expr units)) (let ((unew (math-units-in-expr-p units t)) (std (and (eq ... ...) (assq ... math-standard-units-systems))) (comp (eq (car-safe units) '+))) (if (or unew std calc-allow-units-as-numbers) nil (error "No units specified")) (let* ((noold (and uoldname ...)) (res (if std ... ...))) (if std nil (math-put-default-units (if noold units res) (if comp units))) (calc-enter-result 1 "cvun" res))))) 44)
|   (calc-convert-units)
|   (command-execute calc-convert-units)
| 1 <- math-simplify-units: (frac 1 42827494)

[ Note that special variables (`math-cu-new-units', `math-cu-unit-list',
`math-cu-pure') are being bound there by Calc so just evaluating some of
the stack expression might give you different results. ]

At least the result given by Calc is not incorrect.  It would be better
if it would respect the units explicitly requested by the user, though.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Mon, 17 Apr 2023 04:48:01 GMT) Full text and rfc822 format available.

Message #29 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Roland Winkler <winkler <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Sun, 16 Apr 2023 23:47:23 -0500
On Fri, Apr 14 2023, Michael Heerdegen wrote:
> At least the result given by Calc is not incorrect.  It would be better
> if it would respect the units explicitly requested by the user, though.

The command `calc-convert-units' from the old calc tar ball (from before
calc became part of GNU Emacs) had been doing for me exactly what I
expected for the longest time.  The trouble only started for me when the
old code got modified.  Therefore, some time ago I grabbed the old code
of `calc-convert-units' and put it into my emacs init file.  (In the
code attached below I merely added a let-binding for the internal
variable UNITS.)  This code has been working fine for me since then with
recent versions of GNU Emacs and the likewise more recent versions of
calc they ship with.  (I use this command on a regular basis.)

I suggest to revert the changes of the command `calc-convert-units' and
go back to its old definition.


(defun calc-convert-units (&optional old-units new-units)
  (interactive)
  (calc-slow-wrapper
   (let ((expr (calc-top-n 1))
	 uoldname unew units)
     (or (math-units-in-expr-p expr t)
	 (let ((uold (or old-units
			 (progn
			   (setq uoldname (read-string "Old units: "))
			   (if (equal uoldname "")
			       (progn
				 (setq uoldname "1")
				 1)
			     (if (string-match "\\` */" uoldname)
				 (setq uoldname (concat "1" uoldname)))
			     (math-read-expr uoldname))))))
	   (if (eq (car-safe uold) 'error)
	       (error "Bad format in units expression: %s" (nth 1 uold)))
	   (setq expr (math-mul expr uold))))
     (or new-units
	 (setq new-units (read-string (if uoldname
					  (concat "Old units: "
						  uoldname
						  ", new units: ")
					"New units: "))))
     (if (string-match "\\` */" new-units)
	 (setq new-units (concat "1" new-units)))
     (setq units (math-read-expr new-units))
     (if (eq (car-safe units) 'error)
	 (error "Bad format in units expression: %s" (nth 2 units)))
     (let ((unew (math-units-in-expr-p units t))
	   (std (and (eq (car-safe units) 'var)
		     (assq (nth 1 units) math-standard-units-systems))))
       (if std
	   (calc-enter-result 1 "cvun" (math-simplify-units
					(math-to-standard-units expr
								(nth 1 std))))
	 (or unew
	     (error "No units specified"))
	 (calc-enter-result 1 "cvun"
			    (math-convert-units
			     expr units
			     (and uoldname (not (equal uoldname "1"))))))))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Mon, 17 Apr 2023 14:05:02 GMT) Full text and rfc822 format available.

Message #32 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 17 Apr 2023 16:04:32 +0200
Roland Winkler <winkler <at> gnu.org> writes:

> I suggest to revert the changes of the command `calc-convert-units' and
> go back to its old definition.

I would like to know what the changes since then tried to accomplish/fix
and what we loose when we revert to the old definition.

> (defun calc-convert-units (&optional old-units new-units)
>   (interactive)
> [...]

Reverting only that definition does not fix your
"convert 7m / (c s) to in / (c hr)" example.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Mon, 17 Apr 2023 15:21:01 GMT) Full text and rfc822 format available.

Message #35 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Roland Winkler <winkler <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 17 Apr 2023 10:20:15 -0500
On Mon, Apr 17 2023, Michael Heerdegen wrote:
> I would like to know what the changes since then tried to accomplish/fix
> and what we loose when we revert to the old definition.

That's a very good question.  In my experience, there was never a
problem with the old code where it yielded incorrect results nor have I
encountered a situation where these changes improved anything (in
whatever vague sense).

Most importantly, at some point I checked the bug-gnu-emacs archive,
when I could not find a bug report that could have triggered the changes
in the code, nor there was any explanation in a ChangeLog or commit
message that would have explained why these changes were done.

So from all I can tell, these changes were introduced for no clear
reason, but they only broke things.

>> (defun calc-convert-units (&optional old-units new-units)
>>   (interactive)
>> [...]
>
> Reverting only that definition does not fix your
> "convert 7m / (c s) to in / (c hr)" example.

Good point.  I must have come up with this example at a point in time
when I couldn't check what the old code would do.  In any case, running
this example with the old code yields a behavior that is mathematically
perfectly correct, whereas the new code asks a meaningless question
about a unit for the expression "7m / (c s)".  Strange enough, the old
code even handles fine the case that "7m / (c s)" is converted to a
user-defined dimensionless unit such as Pi.

Again, the bottom line is that the old code works correct, whereas the
new code cannot handle expressions where the units can be simplified to
a dimensionless number.  Therefore, I believe reverting the changes to
calc-convert-units is the best thing to do.  Then, any future changes
should document the use cases they intend to fix or address.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Tue, 18 Apr 2023 23:08:02 GMT) Full text and rfc822 format available.

Message #38 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Wed, 19 Apr 2023 01:07:01 +0200
Roland Winkler <winkler <at> gnu.org> writes:

> Therefore, I believe reverting the changes to calc-convert-units is
> the best thing to do.  Then, any future changes should document the
> use cases they intend to fix or address.

I now tried your originally posted examples (1) and (2) with the old
version of `calc-convert-units' you posted, and they both don't seem to
work as you wish: (1) errors, it just doesn't ask about the old units
before that, and case (2) is also simplified to a plain number.

Are you able to test these cases using that old Calc code?  I first want
to know what are really regressions, and then we can try to find a
solution.  Just going back to the version of `calc-convert-units' you
had posted doesn't seem to do what you want.

BTW, my impression of the intended semantics of
`calc-allow-units-as-numbers' is that an expression that can be
transformed into an equivalent unitless expression will be treated like
a unitless expression, i.e. as a number.  I think this is the opposite
of what you want.

I still agree that the current default behavior is not acceptable in
your examples btw.

TIA,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Fri, 21 Apr 2023 14:27:02 GMT) Full text and rfc822 format available.

Message #41 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Fri, 21 Apr 2023 16:25:52 +0200
Hello Roland,

> [...]
> just want to convert "7 m / (c s)" into something equal to this
> expression.]
>
> Now for the new unit:
>
> (1) If I want to convert "7 m / (c s)" to a plain number, I enter "1",
>     but then Calc throws an error "No units specified".
>     The correct result would be 2.33e-8.
>
> (2) If one wants to convert to the new unit "in / (c hr)" the result
>     returned by calc-convert-units is 2.33e-8, that is, the plain
>     number which would have been the correct result for (1).
>     The new unit "in / (c hr)" is ignored by calc-convert-units.
>     The correct result would be "992125.98 in / (c hr)".

I found that u n (`calc-convert-exact-units') is exactly doing that.
Maybe you are more fortunate with that command - or even used it in the
past?

TIA,
Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Tue, 25 Apr 2023 03:45:02 GMT) Full text and rfc822 format available.

Message #44 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Roland Winkler <winkler <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 24 Apr 2023 22:44:14 -0500
On Wed, Apr 19 2023, Michael Heerdegen wrote:
> Roland Winkler <winkler <at> gnu.org> writes:
> I now tried your originally posted examples (1) and (2) with the old
> version of `calc-convert-units' you posted, and they both don't seem to
> work as you wish: (1) errors, it just doesn't ask about the old units
> before that, and case (2) is also simplified to a plain number.

It may help if you repost the old example from this long thread that you
are refering to.

For me, the essential difference between "old" and "new"
calc-convert-units is that the new version tries to fix a problem that
doesn't exist in the first place.  (It is perfectly fine that a user may
want to feed an expression into calc-convert-units where the combination
of units yields a plane number like (a multiple of) the fine structure
constant.  It is ridiculous if calc-convert-units first wants to give
such an expression a new unit like kg or m^3.

There are probably corner cases where the old (!) code can still be
improved.  But I've given up regarding the new code which, in my
experience, has no base to improve upon unless you first revert it.

This may sound like a harsh judgement, but this endless thread really
has made me tired.

I am just curious: how did you get interested in this bug that was
dormant for the longest time, and where it always seemed to me I was
the only one annoyed by it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15859; Package emacs. (Tue, 25 Apr 2023 03:45:03 GMT) Full text and rfc822 format available.

Message #47 received at 15859 <at> debbugs.gnu.org (full text, mbox):

From: Roland Winkler <winkler <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15859 <at> debbugs.gnu.org
Subject: Re: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 24 Apr 2023 22:44:26 -0500
On Fri, Apr 21 2023, Michael Heerdegen wrote:
> I found that u n (`calc-convert-exact-units') is exactly doing that.
> Maybe you are more fortunate with that command - or even used it in the
> past?

I did not know this command existed, and I haven't used it before.  I
find that this command follows a weird philosophy, and I am not
surprised that this command is only a recent addition to calc (absent in
the "old" calc-2.02f, which, I believe was the last version of calc
before this package became part of GNU Emacs).  I cannot help saying
that all these more recent changes to calc's handling of units were put
in place by someone without a practical day-to-day interest in the
subject.




This bug report was last modified 2 years and 49 days ago.

Previous Next


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