all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "" <jakub-w@riseup.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: master 3843711 3/3: Simplify calculator-expt
Date: Thu, 16 Apr 2020 22:36:54 +0200	[thread overview]
Message-ID: <871ronupzt.fsf@riseup.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 140 bytes --]

Good thing I decided to read the mailing list 5 months after the patch
was submitted. There was a typo that would be pretty hard to catch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Fix-a-typo-in-calculator.el.patch --]
[-- Type: text/x-patch, Size: 941 bytes --]

From 9acd26cf70decf20240f5485d6f12f4cf22c2a80 Mon Sep 17 00:00:00 2001
From: jakub-w <jakub-w@riseup.net>
Date: Thu, 16 Apr 2020 22:07:14 +0200
Subject: [PATCH] Fix a typo in calculator.el

* lisp/calculator.el (calculator-expt): Overflowing exponentiation
caused the function to return -1.0e+INF if the base was an odd,
negative number, no matter what the exponent was.
---
 lisp/calculator.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calculator.el b/lisp/calculator.el
index c1af26ffcc..6996990814 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -1622,7 +1622,7 @@ calculator-expt
     (overflow-error
      ;; X and Y must be integers, as expt silently returns floating-point
      ;; infinity on floating-point overflow.
-     (if (or (natnump x) (zerop (logand x 1)))
+     (if (or (natnump x) (zerop (logand y 1)))
 	 1.0e+INF
        -1.0e+INF))))
 
-- 
2.26.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

             reply	other threads:[~2020-04-16 20:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 20:36 jakub-w [this message]
2020-04-16 20:56 ` master 3843711 3/3: Simplify calculator-expt Paul Eggert
     [not found] <20191105073959.21509.71385@vcs0.savannah.gnu.org>
     [not found] ` <20191105074004.5063220A3C@vcs0.savannah.gnu.org>
2019-11-05 11:28   ` Juanma Barranquero
2019-11-05 21:45     ` Paul Eggert
2019-11-05 19:29   ` Stefan Monnier
2019-11-05 21:47     ` Paul Eggert

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=871ronupzt.fsf@riseup.net \
    --to=jakub-w@riseup.net \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.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.