From f08b1ae89f4fa107826db7359216f56f43b7fa08 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 27 Feb 2019 19:22:26 -0500 Subject: implement as macro to be shared with rand_r --- src/stdlib/_rand.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/stdlib/_rand.h (limited to 'src/stdlib/_rand.h') diff --git a/src/stdlib/_rand.h b/src/stdlib/_rand.h new file mode 100644 index 00000000..7f7102ef --- /dev/null +++ b/src/stdlib/_rand.h @@ -0,0 +1,4 @@ +#include + +#define _rand(_n) \ + (((_n) = (_n) * 1103515245 + 12345) ? (_n) / UINT_MAX % RAND_MAX : 0) -- cgit v1.2.1