+ 1

Why is the value of PI different?

https://code.sololearn.com/WG1tfj9gFvc8/?ref=app I thought the value of PI in the Math Library and the Native PI gotten by division of 22/7 is supposed to be equal or identical.

3rd Apr 2020, 7:35 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar
8 ответов
+ 1
22/7 is not exact value of pi. It is just an assumption and used for calculation. This is the reason programming languages uses different values.
3rd Apr 2020, 7:54 AM
Tricker
0
they say that July 22 is the monthof PI and because it is said that 22/7 is an approximation to pi butnot that it is equal.
3rd Apr 2020, 7:47 AM
Marco
Marco - avatar
0
Marco . So the reason why there are different is because there are both approximations? So in short we don't know which one is correct?
3rd Apr 2020, 7:50 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar
0
PythonPip thanks. It now makes sense. I was also wondering why the sin of a number when i use a calculator on my phone and when i use a native scientific calculator differs. Might that also be the reason why?
3rd Apr 2020, 7:58 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar
0
Mwikisa Delton Kapesa Lufungulo Yes, the answer differs. Because scientific calculators uses different algorithms and logarithm for calculation .
3rd Apr 2020, 8:07 AM
Tricker
0
PythonPip Has anything being done to fix this problem? I once failed my mathematics homework all because i used the calculator on my phone and the teacher used the scientific calculator. We found different answers.
3rd Apr 2020, 8:11 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar
0
PythonPip thanks
3rd Apr 2020, 8:24 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar