Skip to content

Commit

Permalink
Sync SDL3 wiki -> header
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Jun 20, 2024
1 parent 8a80f41 commit e694458
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions include/SDL3/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STR
/**
* Seeds the pseudo-random number generator.
*
* Reusing the seed number will cause SDL_rand_*() to repeat the same stream
* Reusing the seed number will cause SDL_rand_*() to repeat the same stream
* of 'random' numbers.
*
* \param seed the value to use as a random number seed, or 0 to use
Expand Down Expand Up @@ -1308,14 +1308,15 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void);
/**
* Generates a pseudo-random number less than n for positive n
*
* The method used is faster and of better quality than `rand() % n`.
* Odds are roughly 99.9% even for n = 1 million. Evenness is better for
* smaller n, and much worse as n gets bigger.
* The method used is faster and of better quality than `rand() % n`. Odds are
* roughly 99.9% even for n = 1 million. Evenness is better for smaller n, and
* much worse as n gets bigger.
*
* Example: to simulate a d6 use `SDL_rand_n(6) + 1` The +1 converts 0..5 to
* 1..6
*
* If you want reproducible output, be sure to initialize with SDL_srand() first.
* If you want reproducible output, be sure to initialize with SDL_srand()
* first.
*
* There are no guarantees as to the quality of the random sequence produced,
* and this should not be used for security (cryptography, passwords) or where
Expand All @@ -1324,8 +1325,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void);
* of those to meet any serious needs.
*
* \param n the number of possible outcomes. n must be positive.
*
* \returns a random value in the range of [0 .. n-1]
* \returns a random value in the range of [0 .. n-1].
*
* \threadsafety All calls should be made from a single thread
*
Expand All @@ -1339,7 +1339,8 @@ extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_n(Sint32 n);
/**
* Generates a uniform pseudo-random floating point number less than 1.0
*
* If you want reproducible output, be sure to initialize with SDL_srand() first.
* If you want reproducible output, be sure to initialize with SDL_srand()
* first.
*
* There are no guarantees as to the quality of the random sequence produced,
* and this should not be used for security (cryptography, passwords) or where
Expand Down

0 comments on commit e694458

Please sign in to comment.