function mode( p ) {
	if (
		isnan( p ) ||
		p < 0.0 ||
		p > 1.0
	) {
		return NaN;
	}
	return ( p <= 0.5 ) ? 0 : 1;
}
Returns the mode of a Bernoulli distribution.

## Notes

-   For `p = 0.5`, the mode is either `0` or `1`. This implementation returns `0` for `p = 0.5`.

@param {Probability} p - success probability
@returns {NonNegativeInteger} mode

@example
var v = mode( 0.1 );
// returns 0

@example
var v = mode( 0.8 );
// returns 1

@example
var v = mode( 0.5 );
// returns 0

@example
var v = mode( 1.1 );
// returns NaN

@example
var v = mode( NaN );
// returns NaN