function factory( a, b ) {
	if (
		isnan( a ) ||
		isnan( b ) ||
		a >= b
	) {
		return constantFunction( NaN );
	}
	return pdf;

	/**
	* Evaluates the probability density function (PDF) for a uniform distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated PDF
	*
	* @example
	* var y = pdf( 2.0 );
	* // returns <number>
	*/
	function pdf( x ) {
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( x < a || x > b ) {
			return 0.0;
		}
		return 1.0 / ( b - a );
	}
}
Returns a function for evaluating the probability density function (PDF) for a uniform distribution with minimum support `a` and maximum support `b`.

@param {number} a - minimum support
@param {number} b - maximum support
@returns {Function} PDF

@example
var pdf = factory( 0.0, 10.0 );
var y = pdf( 2.0 );
// returns 0.1

y = pdf( 12.0 );
// returns 0.0