EXPORT cpmidp(x,n,conf)
BEGIN
0►P;
n►N;
x►X;
conf►C;
0►A;
1►B;
IF X > 0 THEN
	FNROOT(binomial_cdf(N,P,X)-0.5*binomial(N,X,P)-(0.5+C/2),P,0.5)►A;
END;
IF X < N THEN
	FNROOT(binomial_cdf(N,P,X)-0.5*binomial(N,X,P)-(0.5-C/2),P,0.5)►B;
END;


{A,B};

END;

