calculating largesr power of 2 less than a number

I’ve been playing with SND-FFT, which requires the “length” parameter to be a power of 2

This is a little snippet for calculating the largest power of 2 less than a given number:

(defun highest-power-of-2 (val)
  (do ((n 2 (* n 2)))
      ((> n (/ val 2)) n)))

and an alternative solution:

(defun highest-power-of-2 (val)
  (round (power 2 (truncate (/ (log (float val))(log 2.0))))))