Skip to main content

compute_pi

Function compute_pi 

Source
pub fn compute_pi(precision: usize) -> DBig
Expand description

Compute pi to the given number of decimal digits of precision.

The returned DBig has at most precision significant digits. If precision > 200, the result contains 200 digits (the pre-stored resolution).

ยงExamples

use oxinum_float::compute_pi;
let pi = compute_pi(50);
let s = pi.to_string();
assert!(s.starts_with("3.14159265358979"));