Board index » delphi » D2: Bug in MATH.PAS (Power)

D2: Bug in MATH.PAS (Power)

Hi,

has anyone tried to use Math.Power(0, any non-integer), e.g.
Math.Power(0, 0.5) == sqrt(0) ?

Borland seems to have forgotten to test "base=0" (result=0).

The Delphi Buglists do not list it.
Has this bug been fixed in D2.01?

{$A-,B-,C-,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE GUI}

program Project1;

uses
  Math,
  SysUtils,
  Dialogs,
  Forms;

{$R *.RES}

var
  x: extended;

begin
  x := Math.Power(0, 0.5);
  ShowMessage(FloatToStr(x));
  Application.Initialize;
  Application.Run;
end.

--
Stefan.Hoffmeis...@UNI-Passau.DE
http://kakadu.rz.uni-passau.de/~w4hoff01/
University of Passau, Bavaria, Germany

 

Re:D2: Bug in MATH.PAS (Power)


Quote
Stefan Hoffmeister wrote:

> Hi,

> has anyone tried to use Math.Power(0, any non-integer), e.g.
> Math.Power(0, 0.5) == sqrt(0) ?

> Borland seems to have forgotten to test "base=0" (result=0).

> The Delphi Buglists do not list it.
> Has this bug been fixed in D2.01?

Nope. It still gives 'Floating point division by zero'
where Ln(Base) is calculated.
I'll add it to the bug list.

Reinier.

Re:D2: Bug in MATH.PAS (Power)


I just got an Email asking:

Quote
> Where are these bug lists located??

Maybe it's good to answer that question here:
It's on: http://www.dataweb.nl/~r.p.sterkenburg/bugsall.htm

One more thing:
If you find bugs: let me know by Email. I dont't read this newsgroup
regularly,
so if you post a bug here, there's a big chance I won't see it.

Reinier Sterkenburg.

Re:D2: Bug in MATH.PAS (Power)


Quote
Reinier Sterkenburg <r.p.sterkenb...@dataweb.nl> wrote:
>> has anyone tried to use Math.Power(0, any non-integer), e.g.
>> Math.Power(0, 0.5) == sqrt(0) ?

>> Borland seems to have forgotten to test "base=0" (result=0).

>> The Delphi Buglists do not list it.
>> Has this bug been fixed in D2.01?

>Nope. It still gives 'Floating point division by zero'
>where Ln(Base) is calculated.
>I'll add it to the bug list.

Where are these bug lists located??

---------------------
Al Testani

a...@emi.net
Boca Raton, FL
---------------------

Re:D2: Bug in MATH.PAS (Power)


Stefan Hoffmeister <Stefan.Hoffmeis...@UNI-Passau.DE> wrote in article
<33624be2.2470...@news.rz.uni-passau.de>...

Quote
> Hi,

> has anyone tried to use Math.Power(0, any non-integer), e.g.
> Math.Power(0, 0.5) == sqrt(0) ?

> Borland seems to have forgotten to test "base=0" (result=0).

> The Delphi Buglists do not list it.
> Has this bug been fixed in D2.01?

I don't have Delphi 2.01 installed, but this is definitely fixed in Delphi
3.
--
     - Steve Teixeira
       steixe...@corp.borland.com

Other Threads