Skip to content
Snippets Groups Projects
Commit aed9fe7c authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'random-bool-modfix' into 'master'

Fix missing modulo in random_bool()

See merge request redox-os/relibc!482
parents 85faefc5 e5be15cc
No related branches found
No related tags found
No related merge requests found
Pipeline #15498 failed
......@@ -101,7 +101,7 @@
// Duplicate of lrand48() logic but suitable for multithreaded use
int random_bool() {
_Thread_local static uint64_t xsubi = 0;
xsubi = 0x5deece66d * xsubi + 0xb;
xsubi = (0x5deece66d * xsubi + 0xb) & (0xffffffffffff);
return (xsubi >> 17) % 2 == 0;
}
......
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