vmin   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/math.xtm

4 implementations of vmin: #1 /digego/extempore/tree/v0.8.9/libs/core/math.xtm · #2 /digego/extempore/tree/v0.8.9/libs/core/math.xtm · #3 /digego/extempore/tree/v0.8.9/libs/core/math.xtm · #4 /digego/extempore/tree/v0.8.9/libs/core/math.xtm


Implementation

(bind-func vmin
  (lambda (buf:i64* len:i64)
    (let ((min_val (pref buf 0))
          (i 0))
      (dotimes (i len)
        (if (< (pref buf i) min_val)
            (set! min_val (pref buf i))))
      min_val)))


Back to Index