mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 04:39:22 +02:00
* also invalid argument if trying to calculate 0^0 with intpower()
This commit is contained in:
parent
12a5595b20
commit
a4189bd7fd
@ -640,6 +640,8 @@ function intpower(base : float;const exponent : Integer) : float;
|
|||||||
i : longint;
|
i : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
if (base = 0.0) and (exponent = 0) then
|
||||||
|
InvalidArgument;
|
||||||
i:=abs(exponent);
|
i:=abs(exponent);
|
||||||
intpower:=1.0;
|
intpower:=1.0;
|
||||||
while i>0 do
|
while i>0 do
|
||||||
@ -1342,7 +1344,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.25 2004-12-05 16:43:57 jonas
|
Revision 1.26 2004-12-05 16:52:34 jonas
|
||||||
|
* also invalid argument if trying to calculate 0^0 with intpower()
|
||||||
|
|
||||||
|
Revision 1.25 2004/12/05 16:43:57 jonas
|
||||||
* fixed power() in genmath.inc (code duplication from math.pp for **
|
* fixed power() in genmath.inc (code duplication from math.pp for **
|
||||||
support!)
|
support!)
|
||||||
* fixed power() in math.pp to give an error from 0^0
|
* fixed power() in math.pp to give an error from 0^0
|
||||||
|
Loading…
Reference in New Issue
Block a user