failedtofail
Member
- Joined
- Jun 16, 2022
- Messages
- 20
- Programming Experience
- Beginner
I needed to calculate the formula 2 * PI * freq * 2e-4 :
Using PI = 22/7, I got 0.062857142
However, using PI itself as defined per Math.PI I get 0.062831853
(freq = 50Hz)
The latter result is identical to my calculator and Excel. I was using doubles.
So be warned - it does seem that PI's are not all born equal! (would be interested to know if anyone knows why there is this difference).
Using PI = 22/7, I got 0.062857142
However, using PI itself as defined per Math.PI I get 0.062831853
(freq = 50Hz)
The latter result is identical to my calculator and Excel. I was using doubles.
So be warned - it does seem that PI's are not all born equal! (would be interested to know if anyone knows why there is this difference).