Commit b682966a authored by Jay Belanger's avatar Jay Belanger
Browse files

(calc-integral): With an argument, compute the definite integral.

parent 351b3bee
......@@ -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: ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment