245 |
(and (eq (car (car calc-why)) '*) |
(and (eq (car (car calc-why)) '*) |
246 |
calc-auto-why))) |
calc-auto-why))) |
247 |
(progn |
(progn |
248 |
(calc-extensions) |
(require 'calc-ext) |
249 |
(calc-explain-why (car calc-why) |
(calc-explain-why (car calc-why) |
250 |
(if (eq calc-auto-why t) |
(if (eq calc-auto-why t) |
251 |
(cdr calc-why) |
(cdr calc-why) |
331 |
|
|
332 |
(defun calc-last-args-stub (arg) |
(defun calc-last-args-stub (arg) |
333 |
(interactive "p") |
(interactive "p") |
334 |
(calc-extensions) |
(require 'calc-ext) |
335 |
(calc-last-args arg)) |
(calc-last-args arg)) |
336 |
|
|
337 |
|
|
338 |
(defun calc-power (arg) |
(defun calc-power (arg) |
339 |
(interactive "P") |
(interactive "P") |
340 |
(calc-slow-wrapper |
(calc-slow-wrapper |
341 |
(if (and calc-extensions-loaded |
(if (and (featurep 'calc-ext) |
342 |
(calc-is-inverse)) |
(calc-is-inverse)) |
343 |
(calc-binary-op "root" 'calcFunc-nroot arg nil nil) |
(calc-binary-op "root" 'calcFunc-nroot arg nil nil) |
344 |
(calc-binary-op "^" 'calcFunc-pow arg nil nil '^)))) |
(calc-binary-op "^" 'calcFunc-pow arg nil nil '^)))) |
420 |
When this key is used, calc-ext (the Calculator extensions module) will be |
When this key is used, calc-ext (the Calculator extensions module) will be |
421 |
loaded and the keystroke automatically re-typed." |
loaded and the keystroke automatically re-typed." |
422 |
(interactive "P") |
(interactive "P") |
423 |
(calc-extensions) |
(require 'calc-ext) |
424 |
(if (keymapp (key-binding (char-to-string last-command-char))) |
(if (keymapp (key-binding (char-to-string last-command-char))) |
425 |
(message "%s%c-" (calc-num-prefix-name n) last-command-char)) |
(message "%s%c-" (calc-num-prefix-name n) last-command-char)) |
426 |
(calc-unread-command) |
(calc-unread-command) |
428 |
|
|
429 |
(defun calc-shift-Y-prefix-help () |
(defun calc-shift-Y-prefix-help () |
430 |
(interactive) |
(interactive) |
431 |
(calc-extensions) |
(require 'calc-ext) |
432 |
(calc-do-prefix-help calc-Y-help-msgs "other" ?Y)) |
(calc-do-prefix-help calc-Y-help-msgs "other" ?Y)) |
433 |
|
|
434 |
|
|
467 |
(defun math-concat (v1 v2) |
(defun math-concat (v1 v2) |
468 |
(if (stringp v1) |
(if (stringp v1) |
469 |
(concat v1 v2) |
(concat v1 v2) |
470 |
(calc-extensions) |
(require 'calc-ext) |
471 |
(if (and (or (math-objvecp v1) (math-known-scalarp v1)) |
(if (and (or (math-objvecp v1) (math-known-scalarp v1)) |
472 |
(or (math-objvecp v2) (math-known-scalarp v2))) |
(or (math-objvecp v2) (math-known-scalarp v2))) |
473 |
(append (if (and (math-vectorp v1) |
(append (if (and (math-vectorp v1) |
601 |
|
|
602 |
(defun math-trunc (a &optional math-trunc-prec) |
(defun math-trunc (a &optional math-trunc-prec) |
603 |
(cond (math-trunc-prec |
(cond (math-trunc-prec |
604 |
(calc-extensions) |
(require 'calc-ext) |
605 |
(math-trunc-special a math-trunc-prec)) |
(math-trunc-special a math-trunc-prec)) |
606 |
((Math-integerp a) a) |
((Math-integerp a) a) |
607 |
((Math-looks-negp a) |
((Math-looks-negp a) |
608 |
(math-neg (math-trunc (math-neg a)))) |
(math-neg (math-trunc (math-neg a)))) |
609 |
((eq (car a) 'float) |
((eq (car a) 'float) |
610 |
(math-scale-int (nth 1 a) (nth 2 a))) |
(math-scale-int (nth 1 a) (nth 2 a))) |
611 |
(t (calc-extensions) |
(t (require 'calc-ext) |
612 |
(math-trunc-fancy a)))) |
(math-trunc-fancy a)))) |
613 |
(defalias 'calcFunc-trunc 'math-trunc) |
(defalias 'calcFunc-trunc 'math-trunc) |
614 |
|
|
619 |
|
|
620 |
(defun math-floor (a &optional math-floor-prec) ; [Public] |
(defun math-floor (a &optional math-floor-prec) ; [Public] |
621 |
(cond (math-floor-prec |
(cond (math-floor-prec |
622 |
(calc-extensions) |
(require 'calc-ext) |
623 |
(math-floor-special a math-floor-prec)) |
(math-floor-special a math-floor-prec)) |
624 |
((Math-integerp a) a) |
((Math-integerp a) a) |
625 |
((Math-messy-integerp a) (math-trunc a)) |
((Math-messy-integerp a) (math-trunc a)) |
627 |
(if (Math-negp a) |
(if (Math-negp a) |
628 |
(math-add (math-trunc a) -1) |
(math-add (math-trunc a) -1) |
629 |
(math-trunc a))) |
(math-trunc a))) |
630 |
(t (calc-extensions) |
(t (require 'calc-ext) |
631 |
(math-floor-fancy a)))) |
(math-floor-fancy a)))) |
632 |
(defalias 'calcFunc-floor 'math-floor) |
(defalias 'calcFunc-floor 'math-floor) |
633 |
|
|
643 |
(defun calcFunc-inv (m) |
(defun calcFunc-inv (m) |
644 |
(if (Math-vectorp m) |
(if (Math-vectorp m) |
645 |
(progn |
(progn |
646 |
(calc-extensions) |
(require 'calc-ext) |
647 |
(if (math-square-matrixp m) |
(if (math-square-matrixp m) |
648 |
(or (math-with-extra-prec 2 (math-matrix-inv-raw m)) |
(or (math-with-extra-prec 2 (math-matrix-inv-raw m)) |
649 |
(math-reject-arg m "*Singular matrix")) |
(math-reject-arg m "*Singular matrix")) |
673 |
(math-imod a b)) |
(math-imod a b)) |
674 |
((and (Math-anglep a) (Math-anglep b)) |
((and (Math-anglep a) (Math-anglep b)) |
675 |
(math-sub a (math-mul (math-floor (math-div a b)) b))) |
(math-sub a (math-mul (math-floor (math-div a b)) b))) |
676 |
(t (calc-extensions) |
(t (require 'calc-ext) |
677 |
(math-mod-fancy a b)))) |
(math-mod-fancy a b)))) |
678 |
|
|
679 |
|
|
686 |
((Math-zerop a) |
((Math-zerop a) |
687 |
(if (and (Math-scalarp b) (Math-posp b)) |
(if (and (Math-scalarp b) (Math-posp b)) |
688 |
(if (math-floatp b) (math-float a) a) |
(if (math-floatp b) (math-float a) a) |
689 |
(calc-extensions) |
(require 'calc-ext) |
690 |
(math-pow-of-zero a b))) |
(math-pow-of-zero a b))) |
691 |
((or (eq a 1) (eq b 1)) a) |
((or (eq a 1) (eq b 1)) a) |
692 |
((or (equal a '(float 1 0)) (equal b '(float 1 0))) a) |
((or (equal a '(float 1 0)) (equal b '(float 1 0))) a) |
694 |
(if (Math-scalarp a) |
(if (Math-scalarp a) |
695 |
(if (or (math-floatp a) (math-floatp b)) |
(if (or (math-floatp a) (math-floatp b)) |
696 |
'(float 1 0) 1) |
'(float 1 0) 1) |
697 |
(calc-extensions) |
(require 'calc-ext) |
698 |
(math-pow-zero a b))) |
(math-pow-zero a b))) |
699 |
((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a))) |
((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a))) |
700 |
(if (and (equal a '(float 1 1)) (integerp b)) |
(if (and (equal a '(float 1 1)) (integerp b)) |
702 |
(math-with-extra-prec 2 |
(math-with-extra-prec 2 |
703 |
(math-ipow a b)))) |
(math-ipow a b)))) |
704 |
(t |
(t |
705 |
(calc-extensions) |
(require 'calc-ext) |
706 |
(math-pow-fancy a b)))) |
(math-pow-fancy a b)))) |
707 |
|
|
708 |
(defun math-ipow (a n) ; [O O I] [Public] |
(defun math-ipow (a n) ; [O O I] [Public] |