File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
branches/try/src/libstd/rand Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 07d86b46a949a94223da714e35b343243e4ecce4
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5
- refs/heads/try: 3bd158c665f7f464ed9e0d5b02a408eedbf4d610
5
+ refs/heads/try: 9315d841c7f2041e3b6960a5f5400747b1989647
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change 89
89
//! use std::rand;
90
90
//! use std::rand::distributions::{IndependentSample, Range};
91
91
//!
92
- //! fn dist(x: f64, y: f64) -> f64 {
93
- //! (x*x + y*y).sqrt()
94
- //! }
95
- //!
96
92
//! fn main() {
97
93
//! let between = Range::new(-1f64, 1.);
98
94
//! let mut rng = rand::task_rng();
103
99
//! for _ in range(0u, total) {
104
100
//! let a = between.ind_sample(&mut rng);
105
101
//! let b = between.ind_sample(&mut rng);
106
- //! if dist(a, b) <= 1. {
102
+ //! if a*a + b*b <= 1. {
107
103
//! in_circle += 1;
108
104
//! }
109
105
//! }
You can’t perform that action at this time.
0 commit comments