Last active
November 12, 2017 19:02
-
-
Save Hainish/7fd3769b96e288b6d6d538c0f7a07071 to your computer and use it in GitHub Desktop.
pilindrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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