diff options
| author | Jens Nockert <jens@nockert.se> | 2013-07-08 18:05:17 +0200 | 
|---|---|---|
| committer | Jens Nockert <jens@nockert.se> | 2013-07-08 18:05:17 +0200 | 
| commit | 1aae28a57d42bfd56e0838ddee0a44605922d655 (patch) | |
| tree | 24378e71ef2022a5f6a3021b765b8feba89aa253 /src/libstd/rand.rs | |
| parent | 44770ae3a8001de38b33e449889c6444808941fc (diff) | |
| download | rust-1aae28a57d42bfd56e0838ddee0a44605922d655.tar.gz rust-1aae28a57d42bfd56e0838ddee0a44605922d655.zip | |
 Replaces the free-standing functions in f32, &c.
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
Diffstat (limited to 'src/libstd/rand.rs')
| -rw-r--r-- | src/libstd/rand.rs | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/src/libstd/rand.rs b/src/libstd/rand.rs index 5054763d742..02c8694bf76 100644 --- a/src/libstd/rand.rs +++ b/src/libstd/rand.rs @@ -46,6 +46,7 @@ use container::Container; use int; use iterator::IteratorUtil; use local_data; +use num; use prelude::*; use str; use sys; @@ -463,7 +464,7 @@ impl<R: Rng> RngUtil for R { */ fn gen_int_range(&mut self, start: int, end: int) -> int { assert!(start < end); - start + int::abs(self.gen::<int>() % (end - start)) + start + num::abs(self.gen::<int>() % (end - start)) } /** | 
