您好,歡迎來(lái)電子發(fā)燒友網(wǎng)! ,新用戶?[免費(fèi)注冊(cè)]

您的位置:電子發(fā)燒友網(wǎng)>源碼下載>DSP編程>

DSP的C語(yǔ)言與匯編程序庫(kù)

大?。?/span>41.1 KB 人氣: 2011-06-03 需要積分:0

**********************************************************************/
/*???????????????????????? SPALIB.C?????????????????????????????????? */
/*??????????? SUBPROGRAMS IN ALPHABETICAL ORDER?????????????????????? */
/*????????????? IN THE C PROGRAMMING LANGUAGE???????????????????????? */
/*??????????????????????????????????????????????????????????????????? */
/**********************************************************************/

/* NOTE: The user may wish to include the following in other programs */

/* .................Begin include file.................*/
/* Latest date: 06/23/92 */

#include

/* In the VMS compiler, M_PI is not defined in math.h */

#ifdef vms
#define M_PI??? 3.14159265358979323846
#endif
#ifndef KR
#define M_PI??? 3.14159265358979323846
#endif

#define FALSE?0
#define TRUE?1
#define BIG?1e10
#define SMALL?1e-10
#define ORDER5?1e-5
#define ORDER4?1e-4
#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define MIN(a,b) ((a) <= (b) ? (a) : (b))
#define MAX(a,b) ((a) >= (b) ? (a) : (b))

/* Table of constant values */

static long neg_i1 = -1;
static long pos_i1 = 1;
static long pos_i2 = 2;
static long pos_i4 = 4;
static long pos_i5 = 5;
static float neg_f1 = -1.0;
static float pos_f2 = 2.0;
static double pos_d10 = 10.0;

typedef struct {
?float r, i;
} complex;

typedef struct {
?double r, i;
} doublecomplex;

/* .................End of include file.................*/

/* SPBFCT???? 11/14/85 */
/* GENERATES (I1)!/(I1-I2)!=I1*(I1-1)*...*(I1-I2+1). */
/* NOTE: 0!=1 AND SPBFCT(I,I)=SPBFCT(I,I-1)=I!. */

#ifndef KR
double spbfct(long *i1, long *i2)
#else
double spbfct(i1, i2)
long *i1, *i2;
#endif
{
??? /* Local variables */
??? long i;
??? double ret_val;

??? ret_val = 0.0;
??? if (*i1 < 0 || *i2 < 0 || *i2 > *i1)
??? {
?return(ret_val);
??? }

??? ret_val = 1.0;
??? for (i = *i1 ; i >= (*i1 - *i2 + 1) ; --i)
??? {
?ret_val *= (double) i;
??? }

非常好我支持^.^

(1) 100%

不好我反對(duì)

(0) 0%

      發(fā)表評(píng)論

      用戶評(píng)論
      評(píng)價(jià):好評(píng)中評(píng)差評(píng)

      發(fā)表評(píng)論,獲取積分! 請(qǐng)遵守相關(guān)規(guī)定!

      ?