Skip to content

Commit 0e6c2f6

Browse files
author
Carl Burkert
committed
Use the optval function in the splitmix64 routine
By using the optval function only one write operation to the si variable is necessary.
1 parent 818c071 commit 0e6c2f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stdlib_stats_distribution_PRNG.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#:include "common.fypp"
22
module stdlib_stats_distribution_PRNG
33
use stdlib_kinds, only: int8, int16, int32, int64
4+
use stdlib_optval, only: optval
45
use stdlib_error, only: error_stop
56
implicit none
67
private
@@ -118,8 +119,7 @@ module stdlib_stats_distribution_PRNG
118119
! Values are converted from C unsigned integer of 0x9e3779b97f4a7c15,
119120
! 0xbf58476d1ce4e5b9, 0x94d049bb133111eb
120121

121-
if(present(s)) si = s
122-
res = si
122+
res = optval(s, si)
123123
si = res + int01
124124
res = ieor(res, shiftr(res, 30)) * int02
125125
res = ieor(res, shiftr(res, 27)) * int03

0 commit comments

Comments
 (0)