c3e4c4c8afa0

Cleanup
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 27 Dec 2016 00:18:05 -0500
parents 7f37cc5260ec
children 1aaec79f2887
branches/tags (none)
files losh.lisp

Changes

--- a/losh.lisp	Tue Dec 27 00:15:55 2016 -0500
+++ b/losh.lisp	Tue Dec 27 00:18:05 2016 -0500
@@ -274,13 +274,10 @@
   "Return a random number in (`min`, `max`)."
   (+ (epsilon min) min (random (- max min (epsilon min)))))
 
-(defun random-around (value spread)
-  "Return a random number within `spread` of `value`."
-  (etypecase spread
-    (integer (random-range (- value spread)
-                           (+ value spread 1)))
-    (real (random-range (- value spread)
-                        (+ value spread)))))
+(defun-inlineable random-around (value spread)
+  "Return a random number within `spread` of `value` (inclusive)."
+  (random-range-inclusive (- value spread)
+                          (+ value spread)))
 
 
 (let (spare)