Optimization...
Correction... (needed positive shift values)(defun ceiling-pwr2 (n)
(declare (fixnum n))
(declare (optimize (speed 3) #|(safety 0)|# (space 3) (float 0)))
(let ((nn (sys:integer-to-int32 n)))
(declare (sys:int32 nn))
(labels ((iter (n nsh)
(declare (sys:int32 n))
(declare (fixnum nsh))
(sys:int32-logior n (sys:int32>> n nsh))))
(declare (type '(function (sys:int32 fixnum) sys:int32) iter))
(declare (inline iter))
(sys:int32-to-integer
(sys:int32-1+
(iter
(iter
(iter
(iter
(iter (sys:int32-1- nn) 1)
2)
4)
8)
16)))
)))
Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ 85750
email: dbm@refined-audiometrics.com
phone: 1.520.390.3995