function clampf( v, min, max ) {
	if (
		isnanf( v ) ||
		isnanf( min ) ||
		isnanf( max )
	) {
		return NaN;
	}
	// Simple cases...
	if ( v < min ) {
		return min;
	}
	if ( v > max ) {
		return max;
	}
	// Special cases for handling +-0.0...
	if ( min === 0.0 && isNegativeZerof( v ) ) {
		return min; // +-0.0
	}
	if ( v === 0.0 && isNegativeZerof( max ) ) {
		return max; // -0.0
	}
	// Case: min <= v <= max
	return v;
}
Restricts a single-precision floating-point number to a specified range.

@param {number} v - input value
@param {number} min - minimum value
@param {number} max - maximum value
@returns {number} value restricted to a specified range

@example
var v = clampf( 3.0, 0.0, 5.0 );
// returns 3.0

v = clampf( -3.0, 0.0, 5.0 );
// returns 0.0

v = clampf( 10.0, 0.0, 5.0 );
// returns 5.0

v = clampf( -0.0, 0.0, 5.0 );
// returns 0.0

v = clampf( 0.0, -0.0, 5.0 );
// returns 0.0

v = clampf( NaN, 0.0, 5.0 );
// returns NaN

v = clampf( 0.0, NaN, 5.0 );
// returns NaN

v = clampf( 3.14, 0.0, NaN );
// returns NaN