Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Side by Side Diff: src/IceRNG.cpp

Issue 1216963007: Doxygenize the documentation comments (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase to master Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceRNG.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceRNG.cpp - PRNG implementation -----------------------===// 1 //===- subzero/src/IceRNG.cpp - PRNG implementation -----------------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 ///
10 // This file implements the random number generator. 10 /// \file
11 // 11 /// This file implements the random number generator.
12 ///
12 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
13 14
14 #include "IceRNG.h" 15 #include "IceRNG.h"
15 16
16 #include <time.h> 17 #include <time.h>
17 18
18 namespace Ice { 19 namespace Ice {
19 20
20 namespace { 21 namespace {
21 constexpr unsigned MAX = 2147483647; 22 constexpr unsigned MAX = 2147483647;
(...skipping 12 matching lines...) Expand all
34 // Lewis, Goodman, and Miller (1969) 35 // Lewis, Goodman, and Miller (1969)
35 State = (16807 * State) % MAX; 36 State = (16807 * State) % MAX;
36 return State % Max; 37 return State % Max;
37 } 38 }
38 39
39 bool RandomNumberGeneratorWrapper::getTrueWithProbability(float Probability) { 40 bool RandomNumberGeneratorWrapper::getTrueWithProbability(float Probability) {
40 return RNG.next(MAX) < Probability * MAX; 41 return RNG.next(MAX) < Probability * MAX;
41 } 42 }
42 43
43 } // end of namespace Ice 44 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceRNG.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698