mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-19 22:49:37 +01:00
* improve math.power as suggested by Paolo Valle, resolves #40461
This commit is contained in:
parent
2854f08daa
commit
4794e5ffcf
@ -1714,7 +1714,7 @@ function power(base,exponent : float) : float;
|
||||
result:=1.0
|
||||
else if (base=0.0) and (exponent>0.0) then
|
||||
result:=0.0
|
||||
else if (abs(exponent)<=maxint) and (frac(exponent)=0.0) then
|
||||
else if (frac(exponent)=0.0) and (abs(exponent)<=maxint) then
|
||||
result:=intpower(base,trunc(exponent))
|
||||
else
|
||||
result:=exp(exponent * ln (base));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user