From 3dd4a71b8c9612b6a61461aff191e0a002dfb1e5 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 31 Mar 2015 03:45:41 -0400 Subject: [PATCH] Add type annotations required by rustc 2015-03-31 Closes #38. Signed-off-by: Anders Kaseorg --- src/distributions/mod.rs | 2 +- src/distributions/range.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/distributions/mod.rs b/src/distributions/mod.rs index f637dd01d2a..e33062385b2 100644 --- a/src/distributions/mod.rs +++ b/src/distributions/mod.rs @@ -259,7 +259,7 @@ fn ziggurat( return zero_case(rng, u); } // algebraically equivalent to f1 + DRanU()*(f0 - f1) < 1 - if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen() < pdf(x) { + if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen::() < pdf(x) { return x; } } diff --git a/src/distributions/range.rs b/src/distributions/range.rs index 932bfae4941..3244d11bcc6 100644 --- a/src/distributions/range.rs +++ b/src/distributions/range.rs @@ -153,7 +153,7 @@ macro_rules! float_impl { } } fn sample_range(r: &Range<$ty>, rng: &mut R) -> $ty { - r.low + r.range * rng.gen() + r.low + r.range * rng.gen::<$ty>() } } }