}
BigDecimal q = ONE.subtract( _p );
final BigDecimal EPSILON = BigDecimal.valueOf( 0.1E-320 );
int n = _n.intValue();
if (n > 999999999) {
throw new FormulaException( "#NUM! because n value is too large in CRITBINOM" );
}
BigDecimal factor = q.pow( n );
if (factor.compareTo( EPSILON ) <= 0) {
factor = _p.pow( n );
if (factor.compareTo( EPSILON ) <= 0) {
throw new FormulaException( "#NUM! because factor = 0 in CRITBINOM" );
}
else {
BigDecimal sum = ONE.subtract( factor );
int i;
for (i = 0; i < n && sum.compareTo( _alpha ) >= 0; i++) {