Skip to content

Instantly share code, notes, and snippets.

@Hainish
Last active November 12, 2017 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hainish/7fd3769b96e288b6d6d538c0f7a07071 to your computer and use it in GitHub Desktop.
Save Hainish/7fd3769b96e288b6d6d538c0f7a07071 to your computer and use it in GitHub Desktop.
pilindrome
fn main() {
let mut n = 2_i32;
let mut prob = 1_f64;
loop {
let this_prob = 1_f64 - (1_f64 / 10_f64.powi(n / 2));
prob *= this_prob;
println!("{}", 1_f64 - prob);
n += 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment