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

	/**
	* Evaluates the moment-generating function (MGF) of a uniform distribution.
	*
	* @private
	* @param {number} t - input value
	* @returns {number} evaluated MGF
	*
	* @example
	* var y = mgf( 0.5 );
	* // returns <number>
	*/
	function mgf( t ) {
		var ret;
		if ( isnan( t ) ) {
			return NaN;
		}
		if ( t === 0.0 ) {
			return 1.0;
		}
		// Case: t not equal to zero
		ret = exp( t * b ) - exp( t * a );
		ret /= t * ( b - a );
		return ret;
	}
}
Returns a function for evaluating the moment-generating function (MGF) of a uniform distribution with minimum support `a` and maximum support `b`.

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

@example
var mgf = factory( 6.0, 7.0 );
var y = mgf( 0.1 );
// returns ~1.916

y = mgf( 1.1 );
// returns ~1339.321