Added clamp method for constraining a value to lie within an interval.
Merge pull request #9 from dmcclean/master

Added clamp method for constraining a value to lie within an interval.