Skip to content
Snippets Groups Projects
Commit 7952bdbb authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Integer RNG: Actually use more than 24 bits of randomness

parent fa01a15c
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ class RanluxGenerator(object):
c_type = "int"
rng_expr = ("(shift "
"+ convert_int4((float) scale * gen) "
"+ convert_int4((float) (scale / (1<<24)) * gen))")
"+ convert_int4(((float) scale / (1<<24)) * gen))")
elif dtype == np.int64:
assert distribution == "uniform"
......@@ -230,8 +230,8 @@ class RanluxGenerator(object):
c_type = "long"
rng_expr = ("(shift "
"+ convert_long4((float) scale * gen) "
"+ convert_long4((float) (scale / (1<<24)) * gen)"
"+ convert_long4((float) (scale / (1<<48)) * gen)"
"+ convert_long4(((float) scale / (1<<24)) * gen)"
"+ convert_long4(((float) scale / (1<<48)) * gen)"
")")
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment