unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland Winkler <winkler@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 15859@debbugs.gnu.org
Subject: bug#15859: 24.3.50; Calc - dimensionless units again
Date: Mon, 17 Apr 2023 10:20:15 -0500	[thread overview]
Message-ID: <87jzya8rio.fsf@gnu.org> (raw)
In-Reply-To: <87fs8y7ggf.fsf@web.de> (Michael Heerdegen's message of "Mon, 17 Apr 2023 16:04:32 +0200")

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.





  reply	other threads:[~2023-04-17 15:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 23:35 bug#15859: 24.3.50; Calc - dimensionless units again Roland Winkler
2020-11-22 15:13 ` Michael Heerdegen
2020-11-23 15:13   ` Roland Winkler
2020-11-24  1:00     ` Michael Heerdegen
2020-11-24 23:37       ` Michael Heerdegen
2021-09-06  9:40         ` Lars Ingebrigtsen
2021-09-17  1:45           ` Michael Heerdegen
2023-04-14 15:12 ` Michael Heerdegen
2023-04-17  4:47   ` Roland Winkler
2023-04-17 14:04     ` Michael Heerdegen
2023-04-17 15:20       ` Roland Winkler [this message]
2023-04-18 23:07         ` Michael Heerdegen
2023-04-25  3:44           ` Roland Winkler
2023-04-21 14:25 ` Michael Heerdegen
2023-04-25  3:44   ` Roland Winkler

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=87jzya8rio.fsf@gnu.org \
    --to=winkler@gnu.org \
    --cc=15859@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).