• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/calc/

Lines Matching defs:bignum

1077     math-div2-bignum math-do-working math-evenp math-fixnatnump
2361 ;;; L Normalized bignum digit list (without "bigpos" or "bigneg" symbol)
2383 (math-bignum math-normalize-a)
2522 ;;; Coerce integer A to be a bignum. [B S]
2523 (defun math-bignum (a)
2525 (cons 'bigpos (math-bignum-big a))
2526 (cons 'bigneg (math-bignum-big (- a)))))
2528 (defun math-bignum-big (a) ; [L s]
2531 (cons (% a 1000) (math-bignum-big (/ a 1000)))))
2550 (setq digs (math-div10-bignum digs)
2564 (defun math-div10-bignum (a) ; [l l]
2567 (math-div10-bignum (cdr a)))
2617 (cons (car a) (math-scale-left-bignum (cdr a) n))
2620 (math-scale-left (math-bignum a) n)
2624 (math-scale-left (math-bignum a) 2)
2627 (math-scale-left (math-bignum a) 1)
2630 (defun math-scale-left-bignum (a n)
2635 (math-mul-bignum-digit a (if (= n 2) 100 10) 0)
2642 (cons (car a) (math-scale-right-bignum (cdr a) n))
2656 (defun math-scale-right-bignum (a n) ; [L L S; l l S]
2661 (cdr (math-mul-bignum-digit a (if (= n 2) 10 100) 0))
2672 (math-scale-right-bignum (cdr a) (- -3 n))
2674 (math-mul-bignum-digit (cdr a) 10 0)
2676 (math-mul-bignum-digit (cdr a) 100 0)
2681 (math-add-bignum (cdr val) '(1))
2700 (math-bignum a)
2710 (or (consp a) (setq a (math-bignum a)))
2711 (or (consp b) (setq b (math-bignum b)))
2714 (cons 'bigneg (math-add-bignum (cdr a) (cdr b)))
2716 (let ((diff (math-sub-bignum (cdr b) (cdr a))))
2718 (cons 'bigneg (math-sub-bignum (cdr a) (cdr b)))
2722 (let ((diff (math-sub-bignum (cdr a) (cdr b))))
2724 (cons 'bigneg (math-sub-bignum (cdr b) (cdr a)))
2726 (cons 'bigpos (math-add-bignum (cdr a) (cdr b)))))))
2742 (defun math-add-bignum (a b) ; [L L L; l l l]
2761 (nconc a (math-add-bignum b '(1)))
2776 (defun math-sub-bignum (a b) ; [l l l]
2837 (math-bignum a)
2879 (or (consp a) (setq a (math-bignum a)))
2880 (or (consp b) (setq b (math-bignum b)))
2885 (math-mul-bignum (cdr a) (cdr b))
2886 (math-mul-bignum-digit (cdr a) (nth 1 b) 0))
2887 (math-mul-bignum-digit (cdr b) (nth 1 a) 0))))))
2917 (defun math-mul-bignum (a b)
2923 (math-mul-bignum-digit a (car b) 0)))
2943 (defun math-mul-bignum-digit (a d c)
2968 (let ((res (math-div-bignum-digit (cdr a) b)))
2972 (or (consp a) (setq a (math-bignum a)))
2973 (or (consp b) (setq b (math-bignum b)))
2974 (let ((res (math-div-bignum (cdr a) (cdr b))))
2990 (car (math-div-bignum-digit (cdr a) b)))))
2991 (or (consp a) (setq a (math-bignum a)))
2992 (or (consp b) (setq b (math-bignum b)))
2996 (res (math-div-bignum-big (math-mul-bignum-digit (cdr a) d 0)
2997 (math-mul-bignum-digit (cdr b) d 0)
3003 ;;; Divide a bignum digit list by another. [l.l l L]
3005 (defun math-div-bignum (a b)
3010 (res (math-div-bignum-big (math-mul-bignum-digit a d 0)
3011 (math-mul-bignum-digit b d 0)
3016 (car (math-div-bignum-digit (cdr res) d)))))
3017 (let ((res (math-div-bignum-digit a (car b))))
3020 ;;; Divide a bignum digit list by a digit. [l.D l D]
3021 (defun math-div-bignum-digit (a b)
3023 (let* ((res (math-div-bignum-digit (cdr a) b))
3030 (defun math-div-bignum-big (a b alen blen) ; [l.l l L]
3033 (let* ((res (math-div-bignum-big (cdr a) b (1- alen) blen))
3035 (res2 (math-div-bignum-part num b blen)))
3040 (defun math-div-bignum-part (a b blen) ; a < b*1000 [D.l l L]
3044 (math-div-bignum-try a b (math-mul-bignum-digit b guess 0) guess)))
3046 (defun math-div-bignum-try (a b c guess) ; [D.l l l D]
3047 (let ((rem (math-sub-bignum a c)))
3049 (math-div-bignum-try a b (math-sub-bignum c b) (1- guess))
3257 (math-format-number (math-bignum a))))
3260 ((eq (car a) 'bigpos) (math-format-bignum (cdr a)))
3261 ((eq (car a) 'bigneg) (concat "-" (math-format-bignum (cdr a))))
3278 (math-format-bignum-decimal (cdr mant))))
3298 (math-format-bignum-decimal (cdr mant))))
3342 (defun math-format-bignum (a) ; [X L]
3346 (math-format-bignum-decimal a)
3348 (math-format-bignum-fancy a)))
3350 (defun math-format-bignum-decimal (a) ; [X L]
3375 (cons 'bigpos (math-read-bignum digs))))))
3424 (defun math-read-bignum (s) ; [l X]
3427 (math-read-bignum (substring s 0 -3)))