
23 Sep
2011
23 Sep
'11
7:23 p.m.
On Fri, Sep 23, 2011 at 1:09 PM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
For comparision, the _Clamping (graphics)_ article in Wikipedia uses the current argument order. That article links to clamp functions, using the same order, in the jsPerf library. The Code Project has a 2008 article showing a generic C# Clamp() that uses the same order. I found a number of other examples of the same order. There's even a "preview only" page in MSDN for a float and an int clamp() that follows this order. By contrast, in my quick examination of search results, I didn't find any with the low/middle/high order.
FWIW, OpenCL and Cg also use the clamp(x, min, max) order. --Michael Fawcett