Mercurial > emacs
comparison lisp/calc/calc.el @ 81748:61fb5a974af6
(math-bignum-digit-length): Evaluate when compiled.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sun, 08 Jul 2007 00:11:09 +0000 |
parents | d40120fec750 |
children | 922131bc4a93 |
comparison
equal
deleted
inserted
replaced
81747:673f9f66c0e9 | 81748:61fb5a974af6 |
---|---|
2282 | 2282 |
2283 | 2283 |
2284 | 2284 |
2285 | 2285 |
2286 (defconst math-bignum-digit-length | 2286 (defconst math-bignum-digit-length |
2287 (truncate (/ (log10 (/ most-positive-fixnum 2)) 2)) | 2287 (eval-when-compile |
2288 (truncate (/ (log10 (/ most-positive-fixnum 2)) 2))) | |
2288 "The length of a \"digit\" in Calc bignums. | 2289 "The length of a \"digit\" in Calc bignums. |
2289 If a big integer is of the form (bigpos N0 N1 ...), this is the | 2290 If a big integer is of the form (bigpos N0 N1 ...), this is the |
2290 length of the allowable Emacs integers N0, N1,... | 2291 length of the allowable Emacs integers N0, N1,... |
2291 The value of 2*10^(2*MATH-BIGNUM-DIGIT-LENGTH) must be less than the | 2292 The value of 2*10^(2*MATH-BIGNUM-DIGIT-LENGTH) must be less than the |
2292 largest Emacs integer.") | 2293 largest Emacs integer.") |
3572 '( "*" * 190 191 ) | 3573 '( "*" * 190 191 ) |
3573 (cons | 3574 (cons |
3574 '( "2x" * 190 191 ) | 3575 '( "2x" * 190 191 ) |
3575 math-standard-opers)))) | 3576 math-standard-opers)))) |
3576 | 3577 |
3578 (defvar math-expr-opers (math-standard-ops)) | |
3579 | |
3577 (defun math-standard-ops-p () | 3580 (defun math-standard-ops-p () |
3578 (let ((meo (caar math-expr-opers))) | 3581 (let ((meo (caar math-expr-opers))) |
3579 (and (stringp meo) | 3582 (and (stringp meo) |
3580 (string= meo "*")))) | 3583 (string= meo "*")))) |
3581 | |
3582 (defvar math-expr-opers (math-standard-ops)) | |
3583 | 3584 |
3584 (defun math-expr-ops () | 3585 (defun math-expr-ops () |
3585 (if (math-standard-ops-p) | 3586 (if (math-standard-ops-p) |
3586 (math-standard-ops) | 3587 (math-standard-ops) |
3587 math-expr-opers)) | 3588 math-expr-opers)) |