Improve convergence in Infineon Power MOS.

0**something is 0
This commit is contained in:
Holger Vogt 2024-11-06 15:35:38 +01:00
parent 27e63add5e
commit 0cd676ff18
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,9 @@ PTpower(double arg1, double arg2)
{
double res;
if (newcompat.lt) {
if(arg1 >= 0)
if (arg1 == 0)
res = 0;
else if(arg1 > 0)
res = pow(arg1, arg2);
else {
/* If arg2 is quasi an integer, round it to have pow not fail