mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-21 19:13:07 +00:00
Update rand-range.md
This commit is contained in:
parent
6fe24cb266
commit
0c711552a4
1 changed files with 2 additions and 2 deletions
|
@ -9,8 +9,8 @@ use rand::Rng;
|
|||
|
||||
fn main() {
|
||||
let mut rng = rand::thread_rng();
|
||||
println!("Integer: {}", rng.gen_range(0, 10));
|
||||
println!("Float: {}", rng.gen_range(0.0, 10.0));
|
||||
println!("Integer: {}", rng.gen_range(0..10));
|
||||
println!("Float: {}", rng.gen_range(0.0..10.0));
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue