math-procs.scm 378 B

123456789101112131415
  1. (library (lib math-procs)
  2. (export limit-by-interval)
  3. (import
  4. (except (rnrs base) let-values map error)
  5. (only (guile) lambda* λ)))
  6. (define limit-by-interval
  7. (λ (val min-val max-val)
  8. "Limit a value by an enclosing interval. Both bounds are
  9. inside the interval. The interval is a closed interval."
  10. (max min-val
  11. (min max-val
  12. val))))