⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dcdiveq.c

📁 支持数字元件仿真的SPICE插件
💻 C
字号:
/* * Copyright (c) 1985 Thomas L. Quarles */#include "prefix.h"#include <math.h>#include "suffix.h"RCSID("DCdiveq.c $Revision: 1.1 $ on $Date: 91/04/02 11:48:14 $")#ifdef SHORTMACROvoidDCdiveq(a,b,c,d)    double *a,*b,c,d;{    /* the Double Complex divide-equals operator.  This is done     * as a macro on most machines, but some machines can't handle the     * length of the macros necessary, so the following code is provided     * for them.     *     * this is the complex operation (a,b) /= (c,d)     *     */    double r,s,x,y;    if(FABS(c)>FABS(d)) {         r=(d)/(c);        s=(c)+r*(d);        x=((*(a))+(*(b))*r)/s;        y=((*(b))-(*(a))*r)/s;    } else {         r=(c)/(d);        s=(d)+r*(c);        x=((*(a))*r+(*(b)))/s;        y=((*(b))*r-(*(a)))/s;    }    (*(a)) = x;    (*(b)) = y;}voidDCmult(a,b,c,d,x,y)     double a,b,c,d,*x,*y;{    *(x) = (a) * (c) - (b) * (d) ;    *(y) = (a) * (d) + (b) * (c) ;}voidDCminusEq(a,b,c,d)     double c,d,*a,*b;{    *(a) -= (c) ;    *(b) -= (d) ;}#endif /*SHORTMACRO*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -