Mercurial > emacs
comparison lisp/calc/calc.el @ 44574:f9b633c7d323
(math-format-number): Load `calc-ext' before we call
`math-group-float'.
author | Colin Walters <walters@gnu.org> |
---|---|
date | Sun, 14 Apr 2002 05:50:05 +0000 |
parents | 592d5021b99f |
children | 73f6b3b88ae9 |
comparison
equal
deleted
inserted
replaced
44573:3e16ea61b8c4 | 44574:f9b633c7d323 |
---|---|
3143 str))) | 3143 str))) |
3144 (if (> figs 0) | 3144 (if (> figs 0) |
3145 (setq str (concat (substring str 0 (- figs)) point | 3145 (setq str (concat (substring str 0 (- figs)) point |
3146 (substring str (- figs)))) | 3146 (substring str (- figs)))) |
3147 (setq str (concat str point))) | 3147 (setq str (concat str point))) |
3148 (if calc-group-digits | 3148 (when calc-group-digits |
3149 (setq str (math-group-float str)))) | 3149 (require 'calc-ext) |
3150 (setq str (math-group-float str)))) | |
3150 (if (< figs 0) | 3151 (if (< figs 0) |
3151 (setq figs (+ calc-internal-prec figs))) | 3152 (setq figs (+ calc-internal-prec figs))) |
3152 (if (> figs 0) | 3153 (if (> figs 0) |
3153 (let ((adj (- figs (math-numdigs mant)))) | 3154 (let ((adj (- figs (math-numdigs mant)))) |
3154 (if (< adj 0) | 3155 (if (< adj 0) |
3172 ((> exp 0) | 3173 ((> exp 0) |
3173 (setq str (concat str (make-string exp ?0) point))) | 3174 (setq str (concat str (make-string exp ?0) point))) |
3174 (t ; (< dpos 0) | 3175 (t ; (< dpos 0) |
3175 (setq str (concat "0" point | 3176 (setq str (concat "0" point |
3176 (make-string (- dpos) ?0) str)))) | 3177 (make-string (- dpos) ?0) str)))) |
3177 (if calc-group-digits | 3178 (when calc-group-digits |
3178 (setq str (math-group-float str)))) | 3179 (require 'calc-ext) |
3180 (setq str (math-group-float str)))) | |
3179 (let* ((eadj (+ exp len)) | 3181 (let* ((eadj (+ exp len)) |
3180 (scale (if (eq fmt 'eng) | 3182 (scale (if (eq fmt 'eng) |
3181 (1+ (math-mod (+ eadj 300002) 3)) | 3183 (1+ (math-mod (+ eadj 300002) 3)) |
3182 1))) | 3184 1))) |
3183 (if (> scale (length str)) | 3185 (if (> scale (length str)) |
3184 (setq str (concat str (make-string (- scale (length str)) | 3186 (setq str (concat str (make-string (- scale (length str)) |
3185 ?0)))) | 3187 ?0)))) |
3186 (if (< scale (length str)) | 3188 (if (< scale (length str)) |
3187 (setq str (concat (substring str 0 scale) point | 3189 (setq str (concat (substring str 0 scale) point |
3188 (substring str scale)))) | 3190 (substring str scale)))) |
3189 (if calc-group-digits | 3191 (when calc-group-digits |
3190 (setq str (math-group-float str))) | 3192 (require 'calc-ext) |
3193 (setq str (math-group-float str))) | |
3191 (setq str (format (if (memq calc-language '(math maple)) | 3194 (setq str (format (if (memq calc-language '(math maple)) |
3192 (if (and prec (> prec 191)) | 3195 (if (and prec (> prec 191)) |
3193 "(%s*10.^%d)" "%s*10.^%d") | 3196 "(%s*10.^%d)" "%s*10.^%d") |
3194 "%se%d") | 3197 "%se%d") |
3195 str (- eadj scale))))))) | 3198 str (- eadj scale))))))) |