This is not an approximation. It is a legitimate way to calculate PI. There are many ways to do it.

((4*[math]::Atan(1/5))- [math]::atan(1/239)) * 4

It will calculate PI as far as [math]::pi will. [math]::pi may use this formula or one of the many other formulas for PI. The plus with this formula is that it takes good advantage of the floating point processor. Simple ratios will not.

No ratio can accurately calculate PI. Ratios can be devised that will come ever closer to PI but will never get there. The nexr useful ratio is likely to be published soon. It is likely to be a big number. PowerShell cannot approximate well beyond 355/113 unless we use a 128 bit or larger FPP.

Forgive me for the digression but I do think, as Ed was focusing on in the post, that PowerShell can make for a very good math laboratory. It can be very useful for kids and college students alike.

With the [math] type we can explore many of the advanced elements of fundamental math like trigonometry, calculas, number theory and even set theory. Using MS Graph I suspect we can even explore vector algebra and other things like it.