Re: [HACKERS] random_fract and aix compiler bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] random_fract and aix compiler bug
Дата
Msg-id 24808.1066411060@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] random_fract and aix compiler bug  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Ответы Re: [HACKERS] random_fract and aix compiler bug  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:

!     } while (!(z > 0 && z < MAX_RANDOM_VALUE));

!     } while (z == 0 || z == MAX_RANDOM_VALUE);

This seems fairly ugly, since it eliminates the original coding's
positive guarantee that the final result is in 0 < x < 1.  Does your
compiler manage not to choke if we add a cast instead?

    } while (!(z > 0 && z < (long) MAX_RANDOM_VALUE));

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Zeugswetter Andreas SB SD"
Дата:
Сообщение: [HACKERS] random_fract and aix compiler bug
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] random_fract and aix compiler bug