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

📄 xfpoly.c

📁 Numerical Recipes in C的源代码
💻 C
字号:
/* Driver for routine fpoly */

#include <stdio.h>
#define NRANSI
#include "nr.h"
#include "nrutil.h"

#define NVAL 15
#define DX 0.1
#define NPOLY 5

int main(void)
{
	int i,j;
	float x,*afunc;

	afunc=vector(1,NPOLY);
	printf("\n%38s\n","powers of x");
	printf("%8s %10s %9s %9s %9s %9s\n",
		"x","x**0","x**1","x**2","x**3","x**4");
	for (i=1;i<=NVAL;i++) {
		x=i*DX;
		fpoly(x,afunc,NPOLY);
		printf("%10.4f",x);
		for (j=1;j<=NPOLY;j++) printf("%10.4f",afunc[j]);
		printf("\n");
	}
	free_vector(afunc,1,NPOLY);
	return 0;
}
#undef NRANSI

⌨️ 快捷键说明

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