diff options
| author | Jay Belanger | 2007-06-22 04:09:00 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-06-22 04:09:00 +0000 |
| commit | 3b6d80bc94a396997cdeab4706fa3373a6cc9fb5 (patch) | |
| tree | 50d261ca4a91125abc646aec87d8f59c713b0745 | |
| parent | f9e09a51db6ce66cffa545eea54d516e082460d3 (diff) | |
| download | emacs-3b6d80bc94a396997cdeab4706fa3373a6cc9fb5.tar.gz emacs-3b6d80bc94a396997cdeab4706fa3373a6cc9fb5.zip | |
(math-format-date-part,math-parse-standard-date,calcFunc-julian):
Use `math-read-number-simple' to insert bignums.
| -rw-r--r-- | lisp/calc/calc-forms.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 10bbf7dc3dd..7d4065c40ee 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el | |||
| @@ -558,9 +558,13 @@ | |||
| 558 | ((eq x 'n) | 558 | ((eq x 'n) |
| 559 | (math-format-number (math-floor math-fd-date))) | 559 | (math-format-number (math-floor math-fd-date))) |
| 560 | ((eq x 'J) | 560 | ((eq x 'J) |
| 561 | (math-format-number (math-add math-fd-date '(float (bigpos 235 214 17) -1)))) | 561 | (math-format-number |
| 562 | (math-add math-fd-date | ||
| 563 | (math-read-number-simple "1.7214235")))) | ||
| 562 | ((eq x 'j) | 564 | ((eq x 'j) |
| 563 | (math-format-number (math-add (math-floor math-fd-date) '(bigpos 424 721 1)))) | 565 | (math-format-number (math-add |
| 566 | (math-floor math-fd-date) | ||
| 567 | (math-read-number-simple "1721424")))) | ||
| 564 | ((eq x 'U) | 568 | ((eq x 'U) |
| 565 | (math-format-number (nth 1 (math-date-parts math-fd-date 719164)))) | 569 | (math-format-number (nth 1 (math-date-parts math-fd-date 719164)))) |
| 566 | ((progn | 570 | ((progn |
| @@ -935,9 +939,8 @@ | |||
| 935 | 0 | 939 | 0 |
| 936 | (if (or (eq this 'j) | 940 | (if (or (eq this 'j) |
| 937 | (math-integerp num)) | 941 | (math-integerp num)) |
| 938 | '(bigpos 424 721 1) | 942 | (math-read-number-simple "1721424") |
| 939 | '(float (bigpos 235 214 17) | 943 | (math-read-number-simple "1.7214235")))) |
| 940 | -1)))) | ||
| 941 | hour (or (nth 3 num) hour) | 944 | hour (or (nth 3 num) hour) |
| 942 | minute (or (nth 4 num) minute) | 945 | minute (or (nth 4 num) minute) |
| 943 | second (or (nth 5 num) second) | 946 | second (or (nth 5 num) second) |
| @@ -1146,14 +1149,15 @@ | |||
| 1146 | (defun calcFunc-julian (date &optional zone) | 1149 | (defun calcFunc-julian (date &optional zone) |
| 1147 | (if (math-realp date) | 1150 | (if (math-realp date) |
| 1148 | (list 'date (if (math-integerp date) | 1151 | (list 'date (if (math-integerp date) |
| 1149 | (math-sub date '(bigpos 424 721 1)) | 1152 | (math-sub date (math-read-number-simple "1721424")) |
| 1150 | (setq date (math-sub date '(float (bigpos 235 214 17) -1))) | 1153 | (setq date (math-sub date |
| 1154 | (math-read-number-simple "1.7214235"))) | ||
| 1151 | (math-sub date (math-div (calcFunc-tzone zone date) | 1155 | (math-sub date (math-div (calcFunc-tzone zone date) |
| 1152 | '(float 864 2))))) | 1156 | '(float 864 2))))) |
| 1153 | (if (eq (car date) 'date) | 1157 | (if (eq (car date) 'date) |
| 1154 | (math-add (nth 1 date) (if (math-integerp (nth 1 date)) | 1158 | (math-add (nth 1 date) (if (math-integerp (nth 1 date)) |
| 1155 | '(bigpos 424 721 1) | 1159 | (math-read-number-simple "1721424") |
| 1156 | (math-add '(float (bigpos 235 214 17) -1) | 1160 | (math-add (math-read-number-simple "1.7214235") |
| 1157 | (math-div (calcFunc-tzone zone date) | 1161 | (math-div (calcFunc-tzone zone date) |
| 1158 | '(float 864 2))))) | 1162 | '(float 864 2))))) |
| 1159 | (math-reject-arg date 'datep)))) | 1163 | (math-reject-arg date 'datep)))) |