From 5757b6b20422096de3f4c34e06e8c3b6252d6d85 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Fri, 15 Oct 2021 12:04:02 +0200 Subject: Calc: mend math-nth-root-float (bug#51209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Iñaki Cornejo. * lisp/calc/calc-math.el (math-nth-root-float): Fix old refactoring mistake. * test/lisp/calc/calc-tests.el (calc-nth-root): New test. --- lisp/calc/calc-math.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/calc/calc-math.el') diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 1c2e7bcf2bc..ba2b6b2ca9c 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -618,8 +618,9 @@ If this can't be done, return NIL." (defun math-nth-root-float (a nrf-n &optional guess) (math-inexact-result) (math-with-extra-prec 1 - (let ((math-nrf-nf (math-float nrf-n)) - (math-nrf-nfm1 (math-float (1- nrf-n)))) + (let ((math-nrf-n nrf-n) + (math-nrf-nf (math-float nrf-n)) + (math-nrf-nfm1 (math-float (1- nrf-n)))) (math-nth-root-float-iter a (or guess (math-make-float 1 (/ (+ (math-numdigs (nth 1 a)) -- cgit v1.2.3