Re: Re: [GENERAL] +/- Inf for float8's

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: [GENERAL] +/- Inf for float8's
Дата
Msg-id 26690.966835511@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: [GENERAL] +/- Inf for float8's  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Ответы Re: Re: [GENERAL] +/- Inf for float8's  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Re: Re: [GENERAL] +/- Inf for float8's  ("Henry B. Hotz" <hotz@jpl.nasa.gov>)
Список pgsql-hackers
"Ross J. Reedstrom" <reedstrm@rice.edu> writes:
> !     switch (isinf(num))
> !     {
> !         case -1:
> !             PG_RETURN_CSTRING(strcpy(ascii, "-Infinity"));
> !             break;
> !         case 1:
> !             PG_RETURN_CSTRING(strcpy(ascii, "Infinity"));
> !             break;
> !         default:
> !             break;
> !     }

My man page for isinf() sez:
     isinf() returns a positive integer if x is +INFINITY, or a negative     integer if x is -INFINITY.  Otherwise it
returnszero.
 

so the above switch statement is making an unportable assumption about
exactly which positive or negative value will be returned.

> +     if (isnan(arg2)) PG_RETURN_BOOL(1); 

PG_RETURN_BOOL(true), please...

> !     if (isnan(a))
> !         PG_RETURN_INT32(1);

Do not like this at all --- doesn't it make the result of btint4cmp(NaN,
NaN) dependent on which argument chances to be first?  Seems to me that
you must consider two NaNs to be equal, unless you want to subdivide
the category of NaNs.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: BIT/BIT VARYING status
Следующее
От: Tom Lane
Дата:
Сообщение: fmgr rewrite milestone