drop SIGN(), SIGN(1.0,x) --> SGN(x)

This commit is contained in:
rlar 2016-09-04 20:10:45 +02:00
parent ea5ad6b0e7
commit 4c2e4d0c2f
2 changed files with 8 additions and 9 deletions

View File

@ -35,7 +35,6 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0.0 ? -(a) : (a))
#define SGN(a) ((a) < 0.0 ? -(1.0) : (1.0))
#define SIGN(a,b) ( b >= 0 ? (a >= 0 ? a : - a) : (a >= 0 ? - a : a))
#define SWAP(type, a, b) \
do { \
type SWAP_macro_local = a; \

View File

@ -218,8 +218,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
if (job->TRCVvType[i] == vcode) { /* voltage source */
if ((((VSRCinstance*)(job->TRCVvElt[i]))->VSRCdcValue) *
SIGN(1.0, job->TRCVvStep[i]) -
SIGN(1.0, job->TRCVvStep[i]) * job->TRCVvStop[i] >
SGN(job->TRCVvStep[i]) -
SGN(job->TRCVvStep[i]) * job->TRCVvStop[i] >
DBL_EPSILON * 1e+03)
{
i++;
@ -231,8 +231,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
}
} else if (job->TRCVvType[i] == icode) { /* current source */
if ((((ISRCinstance*)(job->TRCVvElt[i]))->ISRCdcValue) *
SIGN(1.0, job->TRCVvStep[i]) -
SIGN(1.0, job->TRCVvStep[i]) * job->TRCVvStop[i] >
SGN(job->TRCVvStep[i]) -
SGN(job->TRCVvStep[i]) * job->TRCVvStop[i] >
DBL_EPSILON * 1e+03)
{
i++;
@ -244,8 +244,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
}
} else if (job->TRCVvType[i] == rcode) { /* resistance */
if ((((RESinstance*)(job->TRCVvElt[i]))->RESresist) *
SIGN(1.0, job->TRCVvStep[i]) -
SIGN(1.0, job->TRCVvStep[i]) * job->TRCVvStop[i] >
SGN(job->TRCVvStep[i]) -
SGN(job->TRCVvStep[i]) * job->TRCVvStop[i] >
DBL_EPSILON * 1e+03)
{
i++;
@ -256,8 +256,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
goto nextstep;
}
} else if (job->TRCVvType[i] == TEMP_CODE) { /* temp sweep */
if (((ckt->CKTtemp) - CONSTCtoK) * SIGN(1.0, job->TRCVvStep[i]) -
SIGN(1.0, job->TRCVvStep[i]) * job->TRCVvStop[i] >
if (((ckt->CKTtemp) - CONSTCtoK) * SGN(job->TRCVvStep[i]) -
SGN(job->TRCVvStep[i]) * job->TRCVvStop[i] >
DBL_EPSILON * 1e+03)
{
i++;