diff options
| author | Tino Calancha | 2017-05-18 13:15:50 +0900 |
|---|---|---|
| committer | Tino Calancha | 2017-05-18 13:15:50 +0900 |
| commit | eab1a6307b09180bd775cfb6bf7330eb5367bbe0 (patch) | |
| tree | be37a63d69dc8ee218807a6f17d8c821ebc4899f | |
| parent | d4cac417d6d09004390e929b21cd3a2de9f48e0d (diff) | |
| download | emacs-eab1a6307b09180bd775cfb6bf7330eb5367bbe0.tar.gz emacs-eab1a6307b09180bd775cfb6bf7330eb5367bbe0.zip | |
Revert "Ignore angle mode while simplifying units"
This reverts commit 713e922243fb60d850f7b0ff83f3e2a3682f1832.
This commit causes Bug#25652.
| -rw-r--r-- | lisp/calc/calc-forms.el | 12 | ||||
| -rw-r--r-- | lisp/calc/calc-math.el | 12 |
2 files changed, 7 insertions, 17 deletions
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 6aa421ec205..abf76cf07ed 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el | |||
| @@ -317,9 +317,7 @@ | |||
| 317 | (list 'calcFunc-hms a)) | 317 | (list 'calcFunc-hms a)) |
| 318 | ((math-negp a) | 318 | ((math-negp a) |
| 319 | (math-neg (math-to-hms (math-neg a) ang))) | 319 | (math-neg (math-to-hms (math-neg a) ang))) |
| 320 | ((eq (or ang | 320 | ((eq (or ang calc-angle-mode) 'rad) |
| 321 | (and (not math-simplifying-units) calc-angle-mode)) | ||
| 322 | 'rad) | ||
| 323 | (math-to-hms (math-div a (math-pi-over-180)) 'deg)) | 321 | (math-to-hms (math-div a (math-pi-over-180)) 'deg)) |
| 324 | ((memq (car-safe a) '(cplx polar)) a) | 322 | ((memq (car-safe a) '(cplx polar)) a) |
| 325 | (t | 323 | (t |
| @@ -356,16 +354,12 @@ | |||
| 356 | (if (eq (car-safe a) 'sdev) | 354 | (if (eq (car-safe a) 'sdev) |
| 357 | (math-make-sdev (math-from-hms (nth 1 a) ang) | 355 | (math-make-sdev (math-from-hms (nth 1 a) ang) |
| 358 | (math-from-hms (nth 2 a) ang)) | 356 | (math-from-hms (nth 2 a) ang)) |
| 359 | (if (eq (or ang | 357 | (if (eq (or ang calc-angle-mode) 'rad) |
| 360 | (and (not math-simplifying-units) calc-angle-mode)) | ||
| 361 | 'rad) | ||
| 362 | (list 'calcFunc-rad a) | 358 | (list 'calcFunc-rad a) |
| 363 | (list 'calcFunc-deg a))))) | 359 | (list 'calcFunc-deg a))))) |
| 364 | ((math-negp a) | 360 | ((math-negp a) |
| 365 | (math-neg (math-from-hms (math-neg a) ang))) | 361 | (math-neg (math-from-hms (math-neg a) ang))) |
| 366 | ((eq (or ang | 362 | ((eq (or ang calc-angle-mode) 'rad) |
| 367 | (and (not math-simplifying-units) calc-angle-mode)) | ||
| 368 | 'rad) | ||
| 369 | (math-mul (math-from-hms a 'deg) (math-pi-over-180))) | 363 | (math-mul (math-from-hms a 'deg) (math-pi-over-180))) |
| 370 | (t | 364 | (t |
| 371 | (math-add (math-div (math-add (math-div (nth 3 a) | 365 | (math-add (math-div (math-add (math-div (nth 3 a) |
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 2590761d539..faa318d45d0 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el | |||
| @@ -763,14 +763,12 @@ If this can't be done, return NIL." | |||
| 763 | (defun math-to-radians (a) ; [N N] | 763 | (defun math-to-radians (a) ; [N N] |
| 764 | (cond ((eq (car-safe a) 'hms) | 764 | (cond ((eq (car-safe a) 'hms) |
| 765 | (math-from-hms a 'rad)) | 765 | (math-from-hms a 'rad)) |
| 766 | ((and (not math-simplifying-units) | 766 | ((memq calc-angle-mode '(deg hms)) |
| 767 | (memq calc-angle-mode '(deg hms))) | ||
| 768 | (math-mul a (math-pi-over-180))) | 767 | (math-mul a (math-pi-over-180))) |
| 769 | (t a))) | 768 | (t a))) |
| 770 | 769 | ||
| 771 | (defun math-from-radians (a) ; [N N] | 770 | (defun math-from-radians (a) ; [N N] |
| 772 | (cond ((and (not math-simplifying-units) | 771 | (cond ((eq calc-angle-mode 'deg) |
| 773 | (eq calc-angle-mode 'deg)) | ||
| 774 | (if (math-constp a) | 772 | (if (math-constp a) |
| 775 | (math-div a (math-pi-over-180)) | 773 | (math-div a (math-pi-over-180)) |
| 776 | (list 'calcFunc-deg a))) | 774 | (list 'calcFunc-deg a))) |
| @@ -781,16 +779,14 @@ If this can't be done, return NIL." | |||
| 781 | (defun math-to-radians-2 (a &optional force-symbolic) ; [N N] | 779 | (defun math-to-radians-2 (a &optional force-symbolic) ; [N N] |
| 782 | (cond ((eq (car-safe a) 'hms) | 780 | (cond ((eq (car-safe a) 'hms) |
| 783 | (math-from-hms a 'rad)) | 781 | (math-from-hms a 'rad)) |
| 784 | ((and (not math-simplifying-units) | 782 | ((memq calc-angle-mode '(deg hms)) |
| 785 | (memq calc-angle-mode '(deg hms))) | ||
| 786 | (if (or calc-symbolic-mode force-symbolic) | 783 | (if (or calc-symbolic-mode force-symbolic) |
| 787 | (math-div (math-mul a '(var pi var-pi)) 180) | 784 | (math-div (math-mul a '(var pi var-pi)) 180) |
| 788 | (math-mul a (math-pi-over-180)))) | 785 | (math-mul a (math-pi-over-180)))) |
| 789 | (t a))) | 786 | (t a))) |
| 790 | 787 | ||
| 791 | (defun math-from-radians-2 (a &optional force-symbolic) ; [N N] | 788 | (defun math-from-radians-2 (a &optional force-symbolic) ; [N N] |
| 792 | (cond ((and (not math-simplifying-units) | 789 | (cond ((memq calc-angle-mode '(deg hms)) |
| 793 | (memq calc-angle-mode '(deg hms))) | ||
| 794 | (if (or calc-symbolic-mode force-symbolic) | 790 | (if (or calc-symbolic-mode force-symbolic) |
| 795 | (math-div (math-mul 180 a) '(var pi var-pi)) | 791 | (math-div (math-mul 180 a) '(var pi var-pi)) |
| 796 | (math-div a (math-pi-over-180)))) | 792 | (math-div a (math-pi-over-180)))) |