Mercurial > projects > doodle
view doodle/core/misc.d @ 105:7abaf5c3959f
Merge
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Sun, 20 Feb 2011 22:27:06 +1030 |
parents | 15ca7d5cd1ed |
children |
line wrap: on
line source
module doodle.core.misc; // Basic routines. // Note, most of these are probably provided by phobos. double min(in double a, in double b) { return a < b ? a : b; } double max(in double a, in double b) { return a > b ? a : b; } double clamp(in double v, in double min, in double max) { assert(min < max); if (v < min) { return min; } else if (v > max) { return max; } else { return v; } } // wrap?