Function: math-check-fixnum

math-check-fixnum is a byte-compiled function defined in calc-ext.el.gz.

Signature

(math-check-fixnum A &optional ALLOW-INF)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-ext.el.gz
;;; Verify that A is a small integer and return A in integer form.  [S N; - x]
(defun math-check-fixnum (a &optional allow-inf)   ;  [Public]
  (cond ((fixnump a) a)  ; for speed
	((Math-num-integerp a)
	 (let ((a (math-trunc a)))
	   (if (fixnump a)
	       a
	     (math-reject-arg a 'fixnump))))
	((and allow-inf (equal a '(var inf var-inf)))
	 most-positive-fixnum)
	((and allow-inf (equal a '(neg (var inf var-inf))))
	 (- most-positive-fixnum))
	(t (math-reject-arg a 'fixnump))))