Advertisement
PifyZ

rand in Rust

Jul 17th, 2014
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. fn rand(min: int, max: int) -> int {
  2. ((random::<f32>() * ((max - min + 1) as f32)).floor() + (min as f32)) as int
  3. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement