Recognizer for signed integers that fit in a specified bit width
Note that a type-spec of
The guard for
Function:
(defun signed-byte-p (bits x) (declare (xargs :guard t)) (and (integerp bits) (< 0 bits) (let ((y (expt 2 (1- bits)))) (integer-range-p (- y) y x))))