polygon && polygon and precision

Поиск
Список
Период
Сортировка
От Patrick Dowler
Тема polygon && polygon and precision
Дата
Msg-id CAFK8nrrGT53oz_jtX7EUn14G-KaY=HerrSWjTuoz4pn81znoyw@mail.gmail.com
обсуждение исходный текст
Ответы Re: polygon && polygon and precision
Список pgsql-general
I am using polygon datatype with some very small values and discovered that the overlaps operator appears to break down and give false positives for values smaller than ~1e-6. I have tested this on 9.5 (.3 and .16) and 10.10.

To reproduce (these examples only differ in the x-axis exponents) and should be false but the first one is t(rue)

select '((3.0e-07,-2),(9.0e-07,-2),(9.0e-07,1),(3.0e-07,1))'::polygon
    && '((2.0e-07,-0.1),(2.0e-07,0.1),(2.01e-07,0.1),(2.01e-07,-0.1))'::polygon;

select '((3.0e-06,-2),(9.0e-06,-2),(9.0e-06,1),(3.0e-06,1))'::polygon
    && '((2.0e-06,-0.1),(2.0e-06,0.1),(2.01e-06,0.1),(2.01e-06,-0.1))'::polygon;

Maybe suggests some single-precision floating point use in the calculations...

--
Patrick Dowler
Canadian Astronomy Data Centre
Victoria, BC, Canada

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

Предыдущее
От: Nicola Contu
Дата:
Сообщение: Re: Streaming replication - 11.5
Следующее
От: Paul Förster
Дата:
Сообщение: Patroni permanent replication slots