summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2005-10-11 19:41:48 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2005-10-11 19:41:48 +0000
commitb682966a61dafc6658778c83ea6692147a13b0f7 (patch)
treee3ac675f94c132d0a6d2de59f94d426fa3539473 /lisp/calc
parent351b3bee2f61d381f810a097ecc527483cb33f32 (diff)
downloademacs-b682966a61dafc6658778c83ea6692147a13b0f7.tar.gz
(calc-integral): With an argument, compute the definite integral.
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calcalg2.el28
1 files changed, 15 insertions, 13 deletions
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: ")