ReactOS 0.4.15-dev-7968-g24a56f8
rand.c
Go to the documentation of this file.
1/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2#include <precomp.h>
3#include <ntsecapi.h>
4#include <internal/tls.h>
5
6/*
7 * @implemented
8 */
9int
10rand(void)
11{
13
14 /* this is the algorithm used by MSVC, according to
15 * http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators */
16 data->random_seed = data->random_seed * 214013 + 2531011;
17 return (data->random_seed >> 16) & RAND_MAX;
18}
19
20/*
21 * @implemented
22 */
23void
24srand(unsigned int seed)
25{
27 data->random_seed = seed;
28}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define RAND_MAX
Definition: stdlib.h:87
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31
void srand(unsigned int seed)
Definition: rand.c:24
int rand(void)
Definition: rand.c:10