Function compute_pi

Source
pub fn compute_pi(digits: usize) -> Float
Expand description

Calculates the value of pi to a specified number of decimal places using the Gauss-Legendre algorithm and returns Float value.

§Arguments

  • digits - The number of decimal places of pi to calculate, not to exceed 1,292,913,983.

§Returns

A Float representing the calculated value of pi to the specified number of decimal places.