diff options
Diffstat (limited to 'lisp/calc/calc-arith.el')
-rw-r--r-- | lisp/calc/calc-arith.el | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el index b487aae6883..ae397c4f2c4 100644 --- a/lisp/calc/calc-arith.el +++ b/lisp/calc/calc-arith.el @@ -1,4 +1,4 @@ -;;; calc-arith.el --- arithmetic functions for Calc +;;; calc-arith.el --- arithmetic functions for Calc -*- lexical-binding:t -*- ;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc. @@ -250,44 +250,43 @@ (while (setq p (cdr p)) (and (eq (car-safe (car p)) 'vec) (setq vec (nth 2 (car p))) - (condition-case err - (let ((v (nth 1 (car p)))) - (setq type nil range nil) - (or (eq (car-safe vec) 'vec) - (setq vec (list 'vec vec))) - (while (and (setq vec (cdr vec)) - (not (Math-objectp (car vec)))) - (and (eq (car-safe (car vec)) 'var) - (let ((st (assq (nth 1 (car vec)) - math-super-types))) - (cond (st (setq type (append type st))) - ((eq (nth 1 (car vec)) 'pos) - (setq type (append type - '(real number)) - range - '(intv 1 0 (var inf var-inf)))) - ((eq (nth 1 (car vec)) 'nonneg) - (setq type (append type - '(real number)) - range - '(intv 3 0 - (var inf var-inf)))))))) - (if vec - (setq type (append type '(real number)) - range (math-prepare-set (cons 'vec vec)))) - (setq type (list type range)) - (or (eq (car-safe v) 'vec) - (setq v (list 'vec v))) - (while (setq v (cdr v)) - (if (or (eq (car-safe (car v)) 'var) - (not (Math-primp (car v)))) - (setq math-decls-cache - (cons (cons (if (eq (car (car v)) 'var) - (nth 2 (car v)) - (car (car v))) - type) - math-decls-cache))))) - (error nil))))) + (ignore-errors + (let ((v (nth 1 (car p)))) + (setq type nil range nil) + (or (eq (car-safe vec) 'vec) + (setq vec (list 'vec vec))) + (while (and (setq vec (cdr vec)) + (not (Math-objectp (car vec)))) + (and (eq (car-safe (car vec)) 'var) + (let ((st (assq (nth 1 (car vec)) + math-super-types))) + (cond (st (setq type (append type st))) + ((eq (nth 1 (car vec)) 'pos) + (setq type (append type + '(real number)) + range + '(intv 1 0 (var inf var-inf)))) + ((eq (nth 1 (car vec)) 'nonneg) + (setq type (append type + '(real number)) + range + '(intv 3 0 + (var inf var-inf)))))))) + (if vec + (setq type (append type '(real number)) + range (math-prepare-set (cons 'vec vec)))) + (setq type (list type range)) + (or (eq (car-safe v) 'vec) + (setq v (list 'vec v))) + (while (setq v (cdr v)) + (if (or (eq (car-safe (car v)) 'var) + (not (Math-primp (car v)))) + (setq math-decls-cache + (cons (cons (if (eq (car (car v)) 'var) + (nth 2 (car v)) + (car (car v))) + type) + math-decls-cache))))))))) (setq math-decls-all (assq 'var-All math-decls-cache))))) (defun math-known-scalarp (a &optional assume-scalar) @@ -2892,7 +2891,7 @@ (eq a b)) (list 'calcFunc-exp sumpow)) (t - (condition-case err + (condition-case nil (math-pow a sumpow) (inexact-result (list '^ a sumpow))))))))) (and math-simplifying-units @@ -2927,7 +2926,7 @@ (math-div 1 (list 'calcFunc-sqrt (math-mul a b)))) (t (setq a (math-mul a b)) - (condition-case err + (condition-case nil (math-pow a apow) (inexact-result (list '^ a apow))))))))))) |