Function: calcFunc-cot
calcFunc-cot is an autoloaded and byte-compiled function defined in
calc-math.el.gz.
Signature
(calcFunc-cot X)
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-math.el.gz
(defun calcFunc-cot (x) ; [N N] [Public]
(cond ((and (integerp x)
(if (eq calc-angle-mode 'deg)
(= (% (- x 90) 180) 0)
(= x 0)))
0)
((Math-scalarp x)
(math-with-extra-prec 2
(math-cot-raw (math-to-radians (math-float x)))))
((eq (car x) 'sdev)
(if (math-constp x)
(math-with-extra-prec 2
(let* ((xx (math-to-radians (math-float (nth 1 x))))
(xs (math-to-radians (math-float (nth 2 x))))
(sc (math-sin-cos-raw xx)))
(if (and (math-zerop (car sc)) (not calc-infinite-mode))
(progn
(calc-record-why "*Division by zero")
(list 'calcFunc-cot x))
(math-make-sdev (math-div-float (cdr sc) (car sc))
(math-div-float xs (math-sqr (car sc)))))))
(math-make-sdev (calcFunc-cot (nth 1 x))
(math-div (nth 2 x)
(math-sqr (calcFunc-sin (nth 1 x)))))))
((and (eq (car x) 'intv) (math-intv-constp x))
(or (math-with-extra-prec 2
(let* ((xx (math-to-radians (math-float x)))
(na (math-floor (math-div (nth 2 xx) (math-pi))))
(nb (math-floor (math-div (nth 3 xx) (math-pi)))))
(and (equal na nb)
(math-sort-intv (nth 1 x)
(math-cot-raw (nth 2 xx))
(math-cot-raw (nth 3 xx))))))
'(intv 3 (neg (var inf var-inf)) (var inf var-inf))))
((equal x '(var nan var-nan))
x)
(t (calc-record-why 'scalarp x)
(list 'calcFunc-cot x))))