'use strict';

// MODULES //

var isnan = require( '@stdlib/math/base/utils/is-nan' );
var nan = require( './nan.js' );


// MAIN //

/**
* Returns a function for evaluating the quantile function of a degenerate distribution centered at a provided mean value.
*
* @param {number} mu - value at which to center the distribution
* @returns {Function} function to evaluate the quantile function
*
* @example
* var quantile = factory( 5.0 );
* var y = quantile( 0.3 );
* // returns 5.0
* y = quantile( 0.1 );
* // returns 5.0
* y = quantile( 1.1 );
* // returns NaN
*/
function factory( mu ) {
	if ( isnan( mu ) ) {
		return nan;
	}
	return quantile;

	/**
	* Evaluates the quantile function of a degenerate distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.5 );
	* // returns mu
	*/
	function quantile( p ) {
		if ( isnan( p ) || p < 0.0 || p > 1.0 ) {
			return NaN;
		}
		return mu;
	} // end FUNCTION quantile()
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;

@@ -431,16 +431,18 @@
  5.0 );%0A
+*%0A
 * var y 
@@ -469,32 +469,34 @@
  // returns 5.0%0A
+*%0A
 * y = quantile( 
@@ -519,16 +519,18 @@
 rns 5.0%0A
+*%0A
 * y = qu
@@ -878,18 +878,24 @@
 returns 
-mu
+%3Cnumber%3E
 %0A%09*/%0A%09fu

Add empty lines