function ceil2( x ) {
	var sign;
	var p;
	if (
		isnan( x ) ||
		isInfinite( x ) ||
		x === 0.0
	) {
		return x;
	}
	if ( x < 0 ) {
		x = -x;
		sign = -1.0;
	} else {
		sign = 1.0;
	}
	// Solve the equation `2^p = x` for `p`:
	p = log2( x );

	// If provided the smallest subnormal, no rounding possible:
	if ( p === MIN_EXP_SUBNORMAL ) {
		return x;
	}
	// Determine a power of two which rounds the input value toward positive infinity:
	if ( sign === -1.0 ) {
		p = floor( p );
	} else {
		p = ceil( p );
	}
	// Handle overflow:
	if ( p > MAX_EXP ) {
		return PINF;
	}
	return sign * pow( 2.0, p );
}
Rounds a numeric value to the nearest power of two toward positive infinity.

@param {number} x - input value
@returns {number} rounded value

@example
var v = ceil2( 3.141592653589793 );
// returns 4.0

@example
var v = ceil2( 9.0 );
// returns 16.0

@example
var v = ceil2( -0.314 );
// returns -0.25