+ 7
From this html page you could scrape 1 million digits of pi and look up the nth digit by string index.
https://www.piday.org/million/
How many digits do you need? NASA uses only 15 decimal places.
https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimals-of-pi-do-we-really-need/
+ 13
For now... I've used a string for all pi digits
+ 7
Gorom_Pani đ
That's not a spam
Google about m_pi
+ 6
M_PI
+ 3
Ref.Machin's formula.
But Max 15digits.
Ref.my original code
(Source list)
//Machin's formula
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
long double pi ;
pi = 4.0 * (4.0 * atan(1.0 / 5.0) - atan(1.0 / 239.0));
cout << setprecision(15) << pi << endl;
return 0;
}
+ 3
Gorom pani sir.
Sorry.
I not understand solution.
Machin's formula for Wiki.
I studing.Pi analysis.
+ 3
Try using std::numbers::pi_v<long double> defined in <numbers>
I think its somewhat more accurate than M_PI.
But I'm not very sure.
+ 2
using namespace std;
void printValueOfPi()
{
double pi = 2 * asin(1.0);
printf("%f\n", pi);
}
int main()
{
printValueOfPi();
    return 0;
}
Output: 3.141593
+ 1
use M_PI or acos(-1)
+ 1
the result is wrong -32 digit 5288 ... ---> 50288......
0
you can measure the circumference of a circle using a string and a ruler then measure its diameter
then divide the circumference by its diameter!
0
Include math.h and use ROUND function upto the 15th digit đ€
â€ïž From memory 3.1415926 school đž
- 4
Alguien que me enseñe a programar en visual studio c#
- 5
P= 3.14