'use strict';

// MODULES //

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


// MAIN //

/**
* Evaluates the logarithm of the cumulative distribution function (CDF) for a degenerate distribution with a point mass at `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {Probability} evaluated logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
	if ( isnan( x ) || isnan( mu ) ) {
		return NaN;
	}
	return x < mu ? NINF : 0.0;
} // end FUNCTION logcdf()


// EXPORTS //

module.exports = logcdf;

'use strict';

// MODULES //

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


// MAIN //

/**
* Evaluates the natural logarithm of the cumulative distribution function (logCDF) for a degenerate distribution with mean `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {number} natural logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
	if ( isnan( x ) || isnan( mu ) ) {
		return NaN;
	}
	return ( x < mu ) ? NINF : 0.0;
} // end FUNCTION logcdf()


// EXPORTS //

module.exports = logcdf;

Fix return type and add decimal points
Fix return type and add decimal points
