Skip to content

Commit

Permalink
Fix the xoroshiro128 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
stacktracer committed May 24, 2021
1 parent 3cff2a9 commit ab4e925
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xoroshiro128-issue/main.zig
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const std = @import( "std" );

pub fn main( ) void {
// Problem only happens with Xoroshira128, not other PRNGs
// Problem only happens with Xoroshiro128, not other PRNGs
// Problem happens regardless of PRNG seed
var g = std.rand.Xoroshiro128.init( 0 ).random;
var x = std.rand.Xoroshiro128.init( 0 );
var g = &x.random;

// Problem happens with some array sizes but not others
var array = [_]i32 { 0, 0 };
Expand Down

0 comments on commit ab4e925

Please sign in to comment.