res/restemp.c, avoid temporary NaN value, (simplify debugging)
RESupdate_conduct() may be called several times before all parameters have been set via RESparam() invocations, or finally being set to default values in RESsetup() Especially RESscale might still be 0.0 as well as RESm thus temporarily creating a NaN in RESupdate_conduct. This would unnecessarily complicate debugging with enabled floating point exceptions.
This commit is contained in:
parent
5cff30f5c4
commit
3a014f570e
|
|
@ -128,6 +128,9 @@ RESupdate_conduct(RESinstance *here, bool spill_warnings)
|
|||
else
|
||||
factor = (((tc2 * difference) + tc1) * difference) + 1.0;
|
||||
|
||||
if (!here->RESscaleGiven)
|
||||
here->RESscale = 1;
|
||||
|
||||
here->RESconduct = here->RESm / (here->RESresist * factor * here->RESscale);
|
||||
|
||||
/* Paolo Nenzi: AC value */
|
||||
|
|
|
|||
Loading…
Reference in New Issue