不曾用过math.pas.
谢谢分享.

解决方案 »

  1.   

    难免,delphi也是人写的!不过delphi这样会闯大祸了!trunc函数也有错误
    trunc(200)=200
     I=200,trunc(I)=199
      

  2.   

    不会吧!好像忘完了,记不起具体的意思了!
    至少楼上的我看不懂,好像trunc没有错呀!
      

  3.   

    D6的Trunc我用过N次,没出现过这种情况……
      

  4.   

    有谁能帮忙测试一下上面提到的六个函数
    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.   

    我还在用delphi 5,没用6,
    5上面是正常的。我想d6不至于出现如此的大bug吧?d6也出来很久了,应该很多人用在数学上过,如果有这问题肯定早被发现了。
      

  6.   

    我刚查过5和4的Math文件,都没有这三个函数,看来是Delphi6在Math中新提供的。而且看Math文件,发现确实是错了。
      

  7.   

    我看错了, 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;
    改好了吧