function median( p ) {
	if (
		isnan( p ) ||
		p < 0.0 ||
		p > 1.0
	) {
		return NaN;
	}
	return ceil( -1.0 / ( log2( 1.0-p ) ) ) - 1.0;
}
Returns the median of a geometric distribution.

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

@example
var v = median( 0.1 );
// returns 6

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

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

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