Files
c3c/test/unit/stdlib/math/random_xorshiro.c3
Laura Kirsch 5b93212f43 Added Xorshiro128++ random number generator. (#2846)
* Added Xorshiro128++ random number generator.

* Fixes to xorshiro implementation + tests.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-06 20:14:56 +01:00

15 lines
386 B
Plaintext

module xorshiro_test;
import std::math;
fn void test_vectors_xorshiro() @test
{
Xorshiro128PPRandom a = { { 0x1, 0x2, 0x3, 0x4 } };
test::eq(0x281, a.next_int());
test::eq(0x180387, a.next_int());
test::eq(0xc0183387, a.next_int());
a = { { ~0x1, ~0x2, ~0x3, ~0x4 } };
test::eq(0xfffffcfd, a.next_int());
test::eq(0x17fbf8, a.next_int());
test::eq(0x40183386, a.next_int());
}