| От | 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
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера