Skip to content

Commit 933916b

Browse files
authored
change stdlib-random function rtol to ishftc (#714)
* Update stdlib_random.fypp change function `rtol` to fortran intrinsic `ishftc` * Update stdlib_random.fypp
1 parent 6ea8484 commit 933916b

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/stdlib_random.fypp

+2-13
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,16 @@ module stdlib_random
7878
integer(int64) :: res, t
7979

8080
if(.not. seed_initialized) call random_distribution_seed_iint64(si,t)
81-
res = rol64(st(2) * 5, 7) * 9
81+
res = ishftc(st(2) * 5, 7) * 9
8282
t = shiftl(st(2), 17)
8383
st(3) = ieor(st(3), st(1))
8484
st(4) = ieor(st(4), st(2))
8585
st(2) = ieor(st(2), st(3))
8686
st(1) = ieor(st(1), st(4))
8787
st(3) = ieor(st(3), t)
88-
st(4) = rol64(st(4), 45)
88+
st(4) = ishftc(st(4), 45)
8989
end function xoshiro256ss
9090

91-
pure function rol64(x, k) result(res)
92-
integer(int64), intent(in) :: x
93-
integer, intent(in) :: k
94-
integer(int64) :: t1, t2, res
95-
96-
t1 = shiftr(x, (64 - k))
97-
t2 = shiftl(x, k)
98-
res = ior(t1, t2)
99-
end function rol64
100-
101-
10291
function splitmix64(s) result(res)
10392
! Written in 2015 by Sebastiano Vigna ([email protected])
10493
! This is a fixed-increment version of Java 8's SplittableRandom

0 commit comments

Comments
 (0)