# HG changeset patch # User Steve Losh # Date 1481920558 18000 # Node ID c62d7dfcaed7ea6058659482f49589120310d0cd # Parent 0f2460b0b42e95adcda7a6f85f31737c8df3d8fd Add `in-range-p` diff -r 0f2460b0b42e -r c62d7dfcaed7 DOCUMENTATION.markdown --- a/DOCUMENTATION.markdown Thu Dec 15 18:46:31 2016 -0500 +++ b/DOCUMENTATION.markdown Fri Dec 16 15:35:58 2016 -0500 @@ -860,6 +860,12 @@ +### `IN-RANGE-P` (function) + + (IN-RANGE-P LOW VALUE HIGH) + +Return whether `low` <= `value` < `high`. + ### `LERP` (function) (LERP FROM TO N) diff -r 0f2460b0b42e -r c62d7dfcaed7 losh.lisp --- a/losh.lisp Thu Dec 15 18:46:31 2016 -0500 +++ b/losh.lisp Fri Dec 16 15:35:58 2016 -0500 @@ -158,6 +158,11 @@ ((< value min) min) (t value)))) +(defun-inline in-range-p (low value high) + "Return whether `low` <= `value` < `high`." + (and (<= low value) + (< value high))) + (defun gnuplot (data &key (filename "plot.png") diff -r 0f2460b0b42e -r c62d7dfcaed7 package.lisp --- a/package.lisp Thu Dec 15 18:46:31 2016 -0500 +++ b/package.lisp Fri Dec 16 15:35:58 2016 -0500 @@ -38,15 +38,16 @@ :6/8tau :7/8tau - :radians + :clamp :degrees - :square :dividesp + :in-range-p + :lerp + :map-range :norm - :lerp :precise-lerp - :map-range - :clamp + :radians + :square :gnuplot :gnuplot-function))