Mercurial > projects > doodle
view doodle/tk/misc.d @ 28:1754cb773d41
Part-way through getting to compile with configure/builder.
author | Graham St Jack <graham.stjack@internode.on.net> |
---|---|
date | Sun, 02 Aug 2009 16:27:21 +0930 |
parents | tk/misc.d@06c30d250c0a |
children | 960b408d3ac5 |
line wrap: on
line source
module tk.misc; 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; } }