summaryrefslogtreecommitdiff
path: root/test/lisp/calc
diff options
context:
space:
mode:
authorMattias Engdegård <mattiase@acm.org>2021-10-15 12:04:02 +0200
committerMattias Engdegård <mattiase@acm.org>2021-10-15 12:14:05 +0200
commit5757b6b20422096de3f4c34e06e8c3b6252d6d85 (patch)
tree9cfa66dbb48a220025eba9fc34970ba4ea2c12ad /test/lisp/calc
parentd8d71cef9e7b653dbbb0e89ab24eab45e756ed49 (diff)
downloademacs-5757b6b20422096de3f4c34e06e8c3b6252d6d85.tar.gz
emacs-5757b6b20422096de3f4c34e06e8c3b6252d6d85.tar.bz2
emacs-5757b6b20422096de3f4c34e06e8c3b6252d6d85.zip
Calc: mend math-nth-root-float (bug#51209)
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.
Diffstat (limited to 'test/lisp/calc')
-rw-r--r--test/lisp/calc/calc-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index 8a78a068242..3eb6b34c132 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -810,6 +810,12 @@ An existing calc stack is reused, otherwise a new one is created."
(should (equal (calcFunc-test6 3) (* (* 3 2) (- 3 1))))
(should (equal (calcFunc-test7 3) (* 3 2))))
+(ert-deftest calc-nth-root ()
+ ;; bug#51209
+ (let* ((calc-display-working-message nil)
+ (x (calc-tests--calc-to-number (math-pow 8 '(frac 1 6)))))
+ (should (< (abs (- x (sqrt 2.0))) 1.0e-10))))
+
(provide 'calc-tests)
;;; calc-tests.el ends here