| От | Tom Lane |
|---|---|
| Тема | Re: random() function produces wrong range |
| Дата | |
| Msg-id | 27204.965154218@sss.pgh.pa.us обсуждение |
| Ответ на | Re: random() function produces wrong range (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
| Ответы |
Re: random() function produces wrong range
|
| Список | pgsql-general |
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> Actually, on my machines, both man pages for rand() and random() say
> they return values between 0 and RAND_MAX (whether that's true or not
> is another matter). In my case RAND_MAX==INT_MAX so the change wouldn't
> be a problem, but it might be problematic on some of the 64 bit machines.
Oh, that's interesting. What platform do you use? If RAND_MAX applies
to random() on some machines that'd probably explain why the code is
written like it is. But on my box (HPUX) the rand() function is old
and crufty and considerably different from random().
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера