<commit_before>'use strict';

// MODULES //

var PINF = require( '@stdlib/math/constants/float64-pinf' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var nan = require( './nan.js' );


// MAIN //

/**
* Returns a function for evaluating the logarithm of the probability density function (PDF) 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 logarithm of the probability density function
*
* @example
* var logpdf = factory( 5.0 );
* var y = logpdf( 0.0 );
* // returns Number.NEGATIVE_INFINITY
* y = logpdf( 5.0 );
* // returns Number.POSITIVE_INFINITY
*/
function factory( mu ) {
	if ( isnan( mu ) ) {
		return nan;
	}
	return logpdf;

	/**
	* Evaluates the logarithm of the probability density function (PDF) of a degenerate distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} evaluated logarithm of probability density function
	*
	* @example
	* var y = logpdf( 10.0 );
	* // returns Number.POSITIVE_INFINITY || Number.NEGATIVE_INFINITY
	*/
	function logpdf( x ) {
		if ( isnan( x ) ) {
			return NaN;
		}
		return x === mu ? PINF : NINF;
	} // end FUNCTION logpdf()
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;
<commit_msg>Update descriptions<commit_after>'use strict';

// MODULES //

var PINF = require( '@stdlib/math/constants/float64-pinf' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var nan = require( './nan.js' );


// MAIN //

/**
* Returns a function for evaluating the natural logarithm of the probability density function (logPDF) 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 natural logarithm of the probability density function
*
* @example
* var logpdf = factory( 5.0 );
*
* var y = logpdf( 0.0 );
* // returns Number.NEGATIVE_INFINITY
*
* y = logpdf( 5.0 );
* // returns Number.POSITIVE_INFINITY
*/
function factory( mu ) {
	if ( isnan( mu ) ) {
		return nan;
	}
	return logpdf;

	/**
	* Evaluates the natural logarithm of the probability density function (logPDF) of a degenerate distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {number} natural logarithm of the probability density function
	*
	* @example
	* var y = logpdf( 10.0 );
	* // returns <number>
	*/
	function logpdf( x ) {
		if ( isnan( x ) ) {
			return NaN;
		}
		return ( x === mu ) ? PINF : NINF;
	} // end FUNCTION logpdf()
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;

{'fraction_non_alphanumeric': 0.13443565780014377, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 3.403481012658228, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3524614', 'n_tokens_mistral': 963, 'n_tokens_neox': 895, 'n_words': 300}