Browse Source

Add a guard on parameter 'position', limit to

1e-9 to 0.999999999
FIXME: the given parameter limits from ifspec.ifs are not recognized.
pre-master-46
Holger Vogt 3 years ago
parent
commit
ed6f802948
  1. 9
      src/xspice/icm/xtradev/potentiometer/cfunc.mod

9
src/xspice/icm/xtradev/potentiometer/cfunc.mod

@ -18,6 +18,7 @@ AUTHORS
MODIFICATIONS
19 June 1992 Jeffrey P. Murray
22 October 2022 Holger Vogt
SUMMARY
@ -131,6 +132,14 @@ void cm_potentiometer (ARGS)
/* Retrieve frequently used parameters... */
position = PARAM(position);
/* guard against 0 or 1
FIXME: checking the parameter limits is not yet implemented */
if (position <= 0)
position = 1e-9;
else if (position >= 1)
position = 0.999999999;
resistance = PARAM(r);
/* Retrieve input voltages... */

Loading…
Cancel
Save