gint/src/3rdparty/tinymt32/rand.c
Lephe 023675d449
improve structure of sources and formatted printer
* Create an `src/3rdparty` folder for third-party code (to add the
  Grisu2B alfogithm soon).
* Split the formatted printer into gint's kprint (src/kprint), its
  extension and interface (include/gint/kprint.h), and its use in the
  standard stdio functions (src/std/print.c).
* Slightly improve the interface of kformat_geometry() to avoid relying
  on knowing format specifiers.
* Add a function to register more formatters, to allow floating-point
  formatters without requiring them.
2021-02-02 18:19:10 +01:00

15 lines
220 B
C

#include <gint/std/stdlib.h>
#include "tinymt32.h"
static tinymt32_t random;
void srand(unsigned int seed)
{
tinymt32_init(&random, seed);
}
int rand(void)
{
return tinymt32_generate_uint32(&random) & 0x7fffffff;
}