[postgis-devel] Inconsistencies in text output

Sandro Santilli strk at kbt.io
Tue Apr 21 05:14:42 PDT 2020


On Mon, Apr 20, 2020 at 06:18:27PM +0200, rmrodriguez at carto.com wrote:
> On Mon, Apr 20, 2020 at 6:10 PM Sandro Santilli <strk at kbt.io> wrote:
> 
> > Any decimal representation of a floating point number
> > will have this problem, as not all numbers that can be
> > represented by a floating point number can fit on a
> > screen.
> 
> It has been demonstrated that you can guarantee round-trip conversion
> with 17 significant digits.

It depends on the direction. I guess you're after:
  Text -> Binary -> Text

But when you go the other way:
  Binary -> Text -> Binary

The same is not true.

The binary number may have been computed as 1/3.

I'm pretty sure there's something in the PostGIS Trac
about tests with even 0.2 not fitting cleanly.

--strk;


More information about the postgis-devel mailing list