Skip to content

Commit fd1dfd7

Browse files
committed
ADDED: rprand_get_value_raw()
1 parent c04e573 commit fd1dfd7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/external/rprand.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**********************************************************************************************
22
*
3-
* rprand v1.0 - A simple and easy-to-use pseudo-random numbers generator (PRNG)
3+
* rprand v1.1 - A simple and easy-to-use pseudo-random numbers generator (PRNG)
44
*
55
* FEATURES:
66
* - Pseudo-random values generation, 32 bits: [0..4294967295]
@@ -118,6 +118,7 @@ extern "C" { // Prevents name mangling of functions
118118
//----------------------------------------------------------------------------------
119119
RPRANDAPI void rprand_set_seed(unsigned long long seed); // Set rprand_state for Xoshiro128**, seed is 64bit
120120
RPRANDAPI int rprand_get_value(int min, int max); // Get random value within a range, min and max included
121+
RPRANDAPI int rprand_get_value_raw(void); // Get random value, Xoshiro128** generator (uses global rprand_state)
121122

122123
RPRANDAPI int *rprand_load_sequence(unsigned int count, int min, int max); // Load pseudo-random numbers sequence with no duplicates
123124
RPRANDAPI void rprand_unload_sequence(int *sequence); // Unload pseudo-random numbers sequence
@@ -186,6 +187,13 @@ int rprand_get_value(int min, int max)
186187
return value;
187188
}
188189

190+
int rprand_get_value_raw(void)
191+
{
192+
int value = rprand_xoshiro();
193+
194+
return value;
195+
}
196+
189197
// Load pseudo-random numbers sequence with no duplicates, min and max included
190198
int *rprand_load_sequence(unsigned int count, int min, int max)
191199
{

0 commit comments

Comments
 (0)