Here's a special case to clip between 0 and 1, using IEEE magic:
inline void Clip01( const float *src, float *dst ) // *dst = *src clipped between 0 and 1
{
static const int ieeeOne = 0x3f800000;...