DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Is A Value Between Two Other Values?
between?: func [ value bound-1 bound-2 /exclusive /local low-bound high-bound ][ set [low-bound high-bound] sort reduce [bound-1 bound-2] either exclusive [ all [(value > low-bound) (value < high-bound)] ][ ;-- Inclusive comparison all [(value >= low-bound) (value <= high-bound)] ] ]