Function: math-float-fancy

math-float-fancy is an autoloaded and byte-compiled function defined in calc-arith.el.gz.

Signature

(math-float-fancy A)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-arith.el.gz
(defun math-float-fancy (a)
  (cond ((eq (car a) 'intv)
	 (cons (car a) (cons (nth 1 a) (mapcar 'math-float (nthcdr 2 a)))))
	((and (memq (car a) '(* /))
	      (math-numberp (nth 1 a)))
	 (list (car a) (math-float (nth 1 a))
	       (list 'calcFunc-float (nth 2 a))))
	((and (eq (car a) '/)
	      (eq (car (nth 1 a)) '*)
	      (math-numberp (nth 1 (nth 1 a))))
	 (list '* (math-float (nth 1 (nth 1 a)))
	       (list 'calcFunc-float (list '/ (nth 2 (nth 1 a)) (nth 2 a)))))
	((math-infinitep a) a)
	((eq (car a) 'calcFunc-float) a)
	((let ((func (assq (car a) '((calcFunc-floor  . calcFunc-ffloor)
				     (calcFunc-ceil   . calcFunc-fceil)
				     (calcFunc-trunc  . calcFunc-ftrunc)
				     (calcFunc-round  . calcFunc-fround)
				     (calcFunc-rounde . calcFunc-frounde)
				     (calcFunc-roundu . calcFunc-froundu)))))
	   (and func (cons (cdr func) (cdr a)))))
	(t (math-reject-arg a 'objectp))))