如何計算圖周率 ( VB6 )?

2007-03-17 2:52 am
如何計算圖周率 ( VB6 )?

最少要一億位!
更新1:

Re : gao_gai_garhk PLEASE USE CHINESE TO ANSER QUESTION !

回答 (1)

2007-03-17 5:40 am
✔ 最佳答案
To calculate pi, it is not talking about which compiler to use, but the method itself

To calculate pi to 1,000,000,000 digits, there are two ways:

1) implement a BigDouble class. Unfortunately, there is no such a "BigInteger" or "BigDouble" class in C/C++ (but did exist in Java), and the double/long double itself only correct to 7 to 16 digits only. To calculate pi up to such high accuracy, you must have a way to store that 1,000, 000, 000 digits

2) calculate pi one digits by one digits. There exists formula called "BBP formula" that can calculate one digits at one times. For each terms in this formula, it represents one digits in pi, but in base-16. you have to convert back to base-10.

Ref. have many formula that can calculate digits of pi.


收錄日期: 2021-04-23 16:53:38
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070316000051KK02897

檢視 Wayback Machine 備份