turbo pascal7 0之中冪怎麼表示

2022-07-28 09:02:17 字數 975 閱讀 8595

1樓:追月一族

exp(b ln (a)) a 的 b 次方可以表示

2樓:蝶曉夢

} //在這裡要注意,零和負數要特殊處理,否則會造成錯誤,

//如下:

if x>0 then

ans:=exp(y*ln(x))

else

if (x=0) and (y>0) then

ans:=0

else

if (x=0) and (y<0) then writeln('error')

else

if (x<0) and (abs(trunc(y)-y)<0.0000000000000001) then

if trunc(y) mod 2 <> 0 then

ans:=exp(number[p+1]*ln(abs(number[p])))*(-1)

else

ans:=exp(number[p+1]*ln(abs(number[p])))

else

writeln('error');

end;

//上面的ans是計算結果,實型。

3樓:

x的平方是sqr(x)或x*x,如果是立方或更多,只能連乘

4樓:匿名使用者

a 的 b 次方可以表示為: exp( b ln (a) )

實際上用運了自然指數函式 exp(x) 和自然對數函式 ln(x),

只要用換底公式就可以

5樓:匿名使用者

沒有「^」這種表示方法,只有連乘,比如a*a*a

6樓:匿名使用者

就是^例如2的3次方就是2^3

7樓:墨乾筆折

sqr(x)=x*x --比如3的平方 就是 sqr(3)=9;

用turbo pascal程式設計列印輸入的n個整數中的最大 最小數及其序號

var a,i,n,max,min,maxno,minno longint begin while not eof do begin readln n max 1 min maxlongint for i 1 to n do begin read a if a max then begin max ...

matlab7 0安裝金鑰,matlab7 0安裝方法

14 32870 49920 49896 58246 19816 45005 64167 13164 12259 15322 02074 21550 33193 34083 12149 48782 63931 22327 29728 34330 44739 29317 53808 49573 224...

2019超速70扣幾分,2012超速70 扣幾分

扣12分,機動車駕駛證申領和使用規定 裡的規定如下 機動車駕駛人有下列違法行為之一,一次記12分 一 駕駛與準駕車型不符的機動車的 二 飲酒後駕駛機動車的 三 駕駛營運客車 不包括公共汽車 校車載人超過核定人數20 以上的 四 造成交通事故後逃逸,尚不構成犯罪的 五 上道路行駛的機動車未懸掛機動車號...