V
V
Vadim2018-10-13 19:50:10
C++ / C#
Vadim, 2018-10-13 19:50:10

How does rand() work?

Hi all! I want to know how this row works:
x = 1+ (double)rand() / (double)RAND_MAX*(2 - 1);
Output of fractional numbers. RAND_MAX is 32767. Please explain in more detail.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2018-10-13
@POBOGO

It works just like it says in the manual .
What exactly are you interested in?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question