我看错了, D7 是如下的:function ArcCot(const X: Extended): Extended; begin if IsZero(X) then Result := PI / 2 else Result := ArcTan(1 / X); end;function ArcSec(const X: Extended): Extended; begin if IsZero(X) then Result := Infinity else Result := ArcCos(1 / X); end;function ArcCsc(const X: Extended): Extended; begin if IsZero(X) then Result := Infinity else Result := ArcSin(1 / X); end;function ArcCotH(const X: Extended): Extended; begin if SameValue(X, 1) then Result := Infinity else if SameValue(X, -1) then Result := NegInfinity else Result := 0.5 * Ln((X + 1) / (X - 1)); end;function ArcSecH(const X: Extended): Extended; begin if IsZero(X) then Result := Infinity else if SameValue(X, 1) then Result := 0 else Result := Ln((Sqrt(1 - X * X) + 1) / X); end;function ArcCscH(const X: Extended): Extended; begin Result := Ln(Sqrt(1 + (1 / (X * X)) + (1 / X))); end; 改好了吧
trunc(200)=200
I=200,trunc(I)=199
至少楼上的我看不懂,好像trunc没有错呀!
ArcCot(x)=ArcTan(1/X) //Delphi6 误为 ArcCot(x)=Tan(1/X) !
//反正割函数
ArcSec(x)=ArcCos(1/X) //Delphi6 误为 ArcSec(x)=Cos(1/X) !
//反余割函数
ArcCsc(x)=ArcSin(1/X) //Delphi6 误为 ArcCsc(x)=Sin(1/X) !//反双曲余切函数
ArcCotH(x)=ArcTanH(1/X) //Delphi6 误为 ArcCotH(x)=1/ArcCot(X) !
//反双曲正割函数
ArcSecH(x)=ArcCosH(1/X) //Delphi6 误为 ArcSecH(x)=1/ArcSec(X) !
//反双曲余割函数
ArcCscH(x)=ArcSinH(1/X) //Delphi6 误为 ArcCscH(x)=1/ArcCsc(X) !
5上面是正常的。我想d6不至于出现如此的大bug吧?d6也出来很久了,应该很多人用在数学上过,如果有这问题肯定早被发现了。
begin
if IsZero(X) then
Result := PI / 2
else
Result := ArcTan(1 / X);
end;function ArcSec(const X: Extended): Extended;
begin
if IsZero(X) then
Result := Infinity
else
Result := ArcCos(1 / X);
end;function ArcCsc(const X: Extended): Extended;
begin
if IsZero(X) then
Result := Infinity
else
Result := ArcSin(1 / X);
end;function ArcCotH(const X: Extended): Extended;
begin
if SameValue(X, 1) then
Result := Infinity
else if SameValue(X, -1) then
Result := NegInfinity
else
Result := 0.5 * Ln((X + 1) / (X - 1));
end;function ArcSecH(const X: Extended): Extended;
begin
if IsZero(X) then
Result := Infinity
else if SameValue(X, 1) then
Result := 0
else
Result := Ln((Sqrt(1 - X * X) + 1) / X);
end;function ArcCscH(const X: Extended): Extended;
begin
Result := Ln(Sqrt(1 + (1 / (X * X)) + (1 / X)));
end;
改好了吧