 |
Степень


function step(a,b:fload):fload;
begin
textcolor(12);
step:=0;
if a=0
then
if b<=0
then
writeln('Не определена!')
else
step:=0
else
if a>0
then
step:=exp(b*ln(a))
else
if ((b<1)and(b>-1))and(b<>0)
then
if frac(1/b)<>0
then
writeln('Неверная степень!')
else
if frac((1/b)/2)=0
then
writeln('Неверная степень!') else
step:=-exp(b*ln(-a))
else
if (frac(b)<>0)or(b=0)
then
writeln('Не определена!')
else
if frac(b/2)=0
then
step:=exp(b*ln(-a))
else
step:=-exp(b*ln(-a)); textcolor(15);
end;
|