From: Jay Belanger Date: Tue, 11 Oct 2005 19:41:48 +0000 (+0000) Subject: (calc-integral): With an argument, compute the definite integral. X-Git-Tag: emacs-pretest-22.0.90~6662 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b682966a61dafc6658778c83ea6692147a13b0f7;p=emacs.git (calc-integral): With an argument, compute the definite integral. --- diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index a534e4fd459..c0fa5310bf4 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -52,19 +52,21 @@ (setq expr (list func expr var))) (calc-enter-result n "derv" expr)))) -(defun calc-integral (var) - (interactive "sIntegration variable: ") - (calc-slow-wrapper - (if (or (equal var "") (equal var "$")) - (calc-enter-result 2 "intg" (list 'calcFunc-integ - (calc-top-n 2) - (calc-top-n 1))) - (let ((var (math-read-expr var))) - (if (eq (car-safe var) 'error) - (error "Bad format in expression: %s" (nth 1 var))) - (calc-enter-result 1 "intg" (list 'calcFunc-integ - (calc-top-n 1) - var)))))) +(defun calc-integral (var &optional arg) + (interactive "sIntegration variable: \nP") + (if arg + (calc-tabular-command 'calcFunc-integ "Integration" "intg" nil var nil nil) + (calc-slow-wrapper + (if (or (equal var "") (equal var "$")) + (calc-enter-result 2 "intg" (list 'calcFunc-integ + (calc-top-n 2) + (calc-top-n 1))) + (let ((var (math-read-expr var))) + (if (eq (car-safe var) 'error) + (error "Bad format in expression: %s" (nth 1 var))) + (calc-enter-result 1 "intg" (list 'calcFunc-integ + (calc-top-n 1) + var))))))) (defun calc-num-integral (&optional varname lowname highname) (interactive "sIntegration variable: ")