all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 3843711 3/3: Simplify calculator-expt
@ 2020-04-16 20:36 jakub-w
  2020-04-16 20:56 ` Paul Eggert
  0 siblings, 1 reply; 6+ messages in thread
From: jakub-w @ 2020-04-16 20:36 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel


[-- 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 --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread
[parent not found: <20191105073959.21509.71385@vcs0.savannah.gnu.org>]

end of thread, other threads:[~2020-04-16 20:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-16 20:36 master 3843711 3/3: Simplify calculator-expt jakub-w
2020-04-16 20:56 ` 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

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.