Skip to content

Commit 418a93d

Browse files
committed
Seed from time properly
1 parent 37ca97d commit 418a93d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/run_prim.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,8 +1773,7 @@ fn undo_regex(env: &mut Uiua) -> UiuaResult {
17731773
}
17741774

17751775
thread_local! {
1776-
pub(crate) static RNG: RefCell<Xoshiro256Plus> = RefCell::new(Xoshiro256Plus::seed_from_u64(
1777-
SystemTime::now().duration_since(UNIX_EPOCH).map(|t|t.as_micros()).unwrap_or(42) as u64));
1776+
pub(crate) static RNG: RefCell<Xoshiro256Plus> = RefCell::new(Xoshiro256Plus::seed_from_u64(f64::to_bits(crate::now())))
17781777
}
17791778

17801779
/// Generate a random number, equivalent to [`Primitive::Rand`]

0 commit comments

Comments
 (0)