From 0cd676ff180473fece48de27eb8c1e75eb5bff37 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 6 Nov 2024 15:35:38 +0100 Subject: [PATCH] Improve convergence in Infineon Power MOS. 0**something is 0 --- src/spicelib/parser/ptfuncs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spicelib/parser/ptfuncs.c b/src/spicelib/parser/ptfuncs.c index 00e1e63cd..92793f285 100644 --- a/src/spicelib/parser/ptfuncs.c +++ b/src/spicelib/parser/ptfuncs.c @@ -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