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

📄 sqrttab.cpp

📁 这是我本人编写的一个32位定点小数运算的函数库。对于没有浮点运算器的场合
💻 CPP
字号:
// SqrtTab.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main()
{
	FILE *f=fopen("sqtab.txt","wt");
	for (int i=0;i<1024*3+1;i++) {
		int n=i+1024;
		double x=sqrt((double)n/(1024*4));
		int ix=(int)(x*(double)(1<<16)*(double)(1<<16)+0.5);
		printf("%u, ",ix); fprintf(f,"%u, ",ix);
		if (i%6==5) {
			printf("\n"); fprintf(f,"\n");
		}
	}
	fclose(f); getch(); return 0;
}

⌨️ 快捷键说明

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