From: Andreas Schwab <schwab@linux-m68k.org>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 41347@debbugs.gnu.org, Chris Zheng <chriszheng99@gmail.com>,
Eli Barzilay <eli@barzilay.org>
Subject: bug#41347: 28.0.50; calculator.el: Cannot input negative exponents
Date: Sun, 17 May 2020 13:57:50 +0200 [thread overview]
Message-ID: <87pnb2wz7l.fsf@igel.home> (raw)
In-Reply-To: <60FECFFF-BF00-4D6A-9297-105B1E1B69C8@acm.org> ("Mattias Engdegård"'s message of "Sun, 17 May 2020 13:08:30 +0200")
On Mai 17 2020, Mattias Engdegård wrote:
>> @@ -863,7 +863,7 @@ calculator-string-to-number
>> (let* ((str (replace-regexp-in-string
>> "\\.\\([^0-9].*\\)?$" ".0\\1" str))
>> (str (replace-regexp-in-string
>> - "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str)))
>> + "[eE]\\([+-]?\\)?$" "e\\10" str)))
>> (float (string-to-number str)))))
>
> Thanks for the report and the suggested patch! However, I'm not sure what either of these replace-regexp-in-string calls are good for. The first one possibly to accept 1.e23 instead of 1e23; the second one is less clear. Frankly, I think we can drop both.
In commit f248292ede, there was
- ((string-match-p "[eE][+-]?$" str) (concat str "0"))
so the bug is that the part matching "[+-]?" is now dropped.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2020-05-17 11:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-17 5:53 bug#41347: 28.0.50; calculator.el: Cannot input negative exponents Chris Zheng
2020-05-17 11:08 ` Mattias Engdegård
2020-05-17 11:57 ` Andreas Schwab [this message]
2020-05-17 12:18 ` Mattias Engdegård
2020-05-17 20:26 ` Eli Barzilay
2020-05-18 9:28 ` Mattias Engdegård
2020-05-18 15:01 ` Chris Zheng
2020-05-18 15:11 ` Mattias Engdegård
2020-05-18 19:19 ` Eli Barzilay
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pnb2wz7l.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=41347@debbugs.gnu.org \
--cc=chriszheng99@gmail.com \
--cc=eli@barzilay.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.