Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
92732853
Commit
92732853
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting random.h
parent
57a0fa4e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!705
Star formation following Schaye08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/random.h
+3
-1
3 additions, 1 deletion
src/random.h
with
3 additions
and
1 deletion
src/random.h
+
3
−
1
View file @
92732853
...
...
@@ -56,7 +56,9 @@ INLINE static double random_unit_interval(const long long int id,
static
const
double
RAND_MAX_inv
=
1
.
/
((
double
)
RAND_MAX
);
/* Calculate the seed */
unsigned
int
seed
=
((
937LL
*
id
+
1109LL
)
%
2147987LL
+
(
ti_current
-
1
)
%
1514917LL
+
(
long
long
)
type
)
%
seed_range
;
unsigned
int
seed
=
((
937LL
*
id
+
1109LL
)
%
2147987LL
+
(
ti_current
-
1
)
%
1514917LL
+
(
long
long
)
type
)
%
seed_range
;
/* Generate a random number between 0 and 1. */
return
rand_r
(
&
seed
)
*
RAND_MAX_inv
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment