From aa0d0abe3449e1ea4abf40cdfeac3474e6d5861d Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 1 Nov 2020 23:55:32 +0100 Subject: [PATCH] Fix a bug in the limit() function (PSPICE compat mode) --- src/frontend/inpcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index d8608ee4e..cfe1b4617 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -7607,7 +7607,7 @@ static struct card *pspice_compat(struct card *oldcard) new_str = copy(".param gmin = 1e-12"); nextcard = insert_new_line(nextcard, new_str, 3, 0); /* add funcs limit, pwr, pwrs, stp, if, int */ - new_str = copy(".func limit(x, a, b) { min(max(x, a), b) }"); + new_str = copy(".func limit(x, a, b) { max(min(x, a), b) }"); nextcard = insert_new_line(nextcard, new_str, 4, 0); new_str = copy(".func pwr(x, a) { pow(x, a) }"); nextcard = insert_new_line(nextcard, new_str, 5, 0);