Skip to content

Commit 04d7db5

Browse files
committed
Merge pull request #39 from andersk/annotation
Add type annotations required by rustc 2015-03-31
2 parents e0a376a + 3dd4a71 commit 04d7db5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/distributions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn ziggurat<R: Rng, P, Z>(
259259
return zero_case(rng, u);
260260
}
261261
// algebraically equivalent to f1 + DRanU()*(f0 - f1) < 1
262-
if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen() < pdf(x) {
262+
if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen::<f64>() < pdf(x) {
263263
return x;
264264
}
265265
}

src/distributions/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ macro_rules! float_impl {
153153
}
154154
}
155155
fn sample_range<R: Rng>(r: &Range<$ty>, rng: &mut R) -> $ty {
156-
r.low + r.range * rng.gen()
156+
r.low + r.range * rng.gen::<$ty>()
157157
}
158158
}
159159
}

0 commit comments

Comments
 (0)