utils.lisp @ 3512c67e0138

Problem 7, and add a test suite
author Steve Losh <steve@stevelosh.com>
date Sun, 10 Apr 2016 14:30:17 +0000
parents 8d552510fe9d
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)))