mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:19:12 +02:00
* fix power() for negative base
This commit is contained in:
parent
d5373d5971
commit
89d4ca293b
@ -195,12 +195,22 @@
|
|||||||
if (bas<0) and (frac(expo) <> 0) then
|
if (bas<0) and (frac(expo) <> 0) then
|
||||||
handleerror(207)
|
handleerror(207)
|
||||||
else
|
else
|
||||||
power:=exp(ln(bas)*expo);
|
begin
|
||||||
|
power:=exp(ln(abs(bas))*expo);
|
||||||
|
if (bas < 0) and
|
||||||
|
odd(trunc(expo)) then
|
||||||
|
begin
|
||||||
|
power := -power;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.17 2003-11-24 21:57:43 michael
|
Revision 1.18 2003-11-29 16:40:12 jonas
|
||||||
|
* fix power() for negative base
|
||||||
|
|
||||||
|
Revision 1.17 2003/11/24 21:57:43 michael
|
||||||
+ Patch from Johannes Berg for bug 2759
|
+ Patch from Johannes Berg for bug 2759
|
||||||
|
|
||||||
Revision 1.16 2003/11/11 21:08:17 peter
|
Revision 1.16 2003/11/11 21:08:17 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user