utils.lisp @ 20c03264a55e

Problem 8
author Steve Losh <steve@stevelosh.com>
date Sun, 10 Apr 2016 19:17:38 +0000
parents 3512c67e0138
children ef04c7b3d0b8
(in-package #:euler.utils)

(defun random-exclusive (min max)
  "Return an integer in the range (`min`, `max`)."
  (+ 1 min (random (- max min 1))))

(defun dividesp (n divisor)
  "Return whether `n` is evenly divisible by `divisor`."
  (zerop (mod n divisor)))