7825677899最后结果:
ZJ_dfZ=245850928.81
ZJ_dmfZ=78256778.99
``
```
// ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include <iostream>
using namespace std;
#define pifZ 245850922
#define pifM 78256779
#define PI 3.14159265358979323846f
#define PI100 314.159265358979323846f
int main()
{
std::cout << "Hello World!\n";
double zuijin_dfZ = 24585092100; // pifZ;
double zuijin_dmfM = 7825677800; //pifM;
double zuijin = pifZ/pifM;
double zuixiao = 1.0; // abs(zuijin - PI);
__int64 dfenMui64 = 0;
for (double d1z = 245850921000; d1z <= 245850929000; d1z = 1 + d1z) {//for110
for (double dm = 78256778000; dm <= 78256781000; dm = 1 + dm) {
// double dfZ = d + pifZ;
// double dmfM = dm + pifM;
double tmp_p = double((double)d1z / dm);
if (zuixiao > (abs( 3.14159265358979323846f -tmp_p) ) ) {
zuijin = tmp_p; zuixiao = abs( 3.14159265358979323846f-tmp_p);
zuijin_dfZ = d1z; zuijin_dmfM = dm;
cout << "ZJ_dfZ=" << zuijin_dfZ << endl;
cout << "ZJ_dmfZ=" << zuijin_dmfM << endl;
cout << "tmp_PI:" << tmp_p<<endl;
cout << "zuiXiao:" << zuixiao<<endl;
dfenMui64 = (__int64)dm;
cout << ':' << dfenMui64;
}//if210
// cout <<':'<< dmi64 ;
}//for110
}
__int64 d1fenZi64 = (__int64)zuijin_dfZ;
cout << "最后结果:" << endl;
std::cout << "ZJ_dfZ=" << d1fenZi64 <<endl;
cout << "ZJ_dmfZ=" << dfenMui64 << endl;
}//main()
```
:78256778658ZJ_dfZ=2.45851e+11
ZJ_dmfZ=7.82568e+10
tmp_PI:3.14159
zuiXiao:5.32907e-15
:78256778884最后结果:
ZJ_dfZ=245850928.477
ZJ_dmfZ=78256778.884
-----------------------------------
:782567780ZJ_dfZ=2.45851e+09
ZJ_dmfZ=7.82568e+08
tmp_PI:3.14159
zuiXiao:2.14095e-12
:782567780最后结果:
ZJ_dfZ=245850925.7
ZJ_dmfZ=78256778.0
- R高精“密率”-PI的分数的高精度表示形式-R语言181000a
- 高精“密率”-PI的分数的高精度表示形式181001
- java40k2011Terryfix181002
- PI的高精度分数表示形式180101
- c++算PI的分数表示形式180102
- 单圆弧的反射181001a
- 单个圆的圆弧反射181020a
- 附录11:181001非控制台(WindowsForm)窗口程序创建控制台(调试程序用
- 递归调用-判断两圆相碰撞情况181020
- 用递归算法模拟两圆反射Billiards181020
- 光线(粒子)在两圆间碰撞效果1810a
- 光线粒子在两圆内壁碰撞效果1810B
- twoBillards模拟光线(粒子)在重叠的两圆内壁的碰撞C++完整代码(带注释)Terry181001