Re: rint() replacement

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: rint() replacement
Дата
Msg-id D90A5A6C612A39408103E6ECDD77B8294CDC32@voyager.corporate.connx.com
обсуждение исходный текст
Ответ на rint() replacement  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: rint() replacement  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
This is the rint() definition:
http://www.gnu.org/manual/glibc-2.2.5/html_node/Rounding-Functions.html

There was a bug in glibc rint, but I think it has been fixed.

Probably, most of the time nearbyint() is what is really wanted instead
of rint().  The rint() function can throw an exception even when it does
what is wanted.

If the current rounding mode is round toward -INF, rint(x) is identical
to floor(x).

If the current rounding mode is round toward +INF, rint(x) is identical
to ceil(x).

If the current rounding mode is round to nearest, rint(x) is identical
to nearest(x).

If the current rounding mode is round toward zero, rint(x) is identical
to trunc(x).

Most of the time, this is what rint() is doing if we are round to
nearest:
return floor(x+0.5);

> -----Original Message-----
> From: Andrew Dunstan [mailto:andrew@dunslane.net]
> Sent: Friday, May 09, 2003 11:54 AM
> To: PostgreSQL-development
> Subject: Re: [HACKERS] rint() replacement
>
>
>
> speaking of rint(), I just got this on Linux on a clean get from CVS:
>
> gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -fpic -I../../../. ./src/interfaces/ecpg/include
> -I../../../../src/include/utils -I../../../../
> src/include   -c -o dt_common.o dt_common.c
> dt_common.c: In function `dt2time':
> dt_common.c:1271: warning: implicit declaration of function `rint'
>
> which I guess is kinda undesirable...
>
> andrew
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>



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

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: rint() replacement
Следующее
От: Robert Treat
Дата:
Сообщение: Re: 7.4 features list