Liking cljdoc? Tell your friends :D
Clojure only.

quil.helpers.calc


mod-rangeclj

(mod-range val min max)

Similar to mod except allows min to be non-zero. Always returns a val within the range min (inclusive) to max (exclusive). Throws an exception if min is greater than max.

Similar to mod except allows min to be non-zero. Always returns a
val within the range min (inclusive) to max (exclusive). Throws an
exception if min is greater than max.
sourceraw docstring

mul-addclj

(mul-add s mul add)

Generate a potential lazy sequence of values which is the result of multiplying each s by mul and then adding add. s mul and add may be seqs in which case the result will also be seq with the length being the same as the shortest input seq (similar to the behaviour of map). If all the seqs passed are infinite lazy seqs, the result will also be infinite and lazy..

(mul-add 2 2 1) ;=> 5 (mul-add [2 2] 2 1) ;=> [5 5] (mul-add [2 2] [2 4 6] 1) ;=> [5 9] (mul-add (range) 2 1) ;=> [1 3 5 7 9 11 13...] ;; infinite seq (mul-add (range) [2 2] 1) ;=> [1 3]

Generate a potential lazy sequence of values which is the result of
multiplying each s by mul and then adding add. s mul and add may be
seqs in which case the result will also be seq with the length
being the same as the shortest input seq (similar to the behaviour
of map). If all the seqs passed are infinite lazy seqs, the result
will also be infinite and lazy..

(mul-add 2 2 1)           ;=> 5
(mul-add [2 2] 2 1)       ;=> [5 5]
(mul-add [2 2] [2 4 6] 1) ;=> [5 9]
(mul-add (range) 2 1)     ;=> [1 3 5 7 9 11 13...] ;; infinite seq
(mul-add (range) [2 2] 1) ;=> [1 3]
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close