Re: my float function returns NaN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: my float function returns NaN
Дата
Msg-id 2542.1333810462@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: my float function returns NaN  (Nathaniel Trellice <naptrel@yahoo.co.uk>)
Ответы Re: my float function returns NaN  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-novice
Nathaniel Trellice <naptrel@yahoo.co.uk> writes:
> My guess would be that due to rounding errors, the argument passed to
> acos() is outwith the interval [-1,1] and acos() is only defined
> within this interval (for reals).

Yeah.  It's not helping any that you've defined geo_deg2rad() to do its
arithmetic in float (that is float4) precision.  Making it work in
float8 would probably improve matters.  Still, I agree that switching to
a more numerically stable distance calculation would be a good idea.

            regards, tom lane

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

Предыдущее
От: Nathaniel Trellice
Дата:
Сообщение: Re: my float function returns NaN
Следующее
От: Frank Bax
Дата:
Сообщение: Re: my float function returns NaN