From 24b0c51a3b51c52dbba855787170107a6a7e47fb Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 19 Jul 2022 10:44:16 -0500 Subject: [add] canvas language and [example] --- src/utils.lisp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/utils.lisp') diff --git a/src/utils.lisp b/src/utils.lisp index f3dba06..4ace1b8 100644 --- a/src/utils.lisp +++ b/src/utils.lisp @@ -150,3 +150,7 @@ the path." sum (* coeff y) into by finally (return (list bx by)))))) +(defun clamp (lo val hi) + "Returns VAL if (< LO VAL HI), otherwise returns LO or HI depending +on which boundary VAL is outside of." + (max lo (min val hi))) -- cgit v1.2.3