[postgis-devel] Inconsistencies in text output

Martin Davis mtnclimb at gmail.com
Mon Apr 20 10:32:24 PDT 2020


It does seem like binary fractions can be represented exactly as decimal
numbers.  The converse is not true, however.  So does that mean that even
if a binary FP number is output "exactly" as decimal, it might not read
back in the same way?  Does ryu support this?  (And even if Ryu does, other
systems might not).

This in indeed the rationale for WKB - it removes all these kinds of
finicky questions about round-tripping.

For the record, I'm not concerned about round-tripping, just about
getting the behavior of limited-precision output correct.

On Mon, Apr 20, 2020 at 9:18 AM <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's true that with decimal notation it
> will require more characters, but with Postgis constraints this seems
> to require at most 33 characters, which is way less than what a screen
> fits.
>
> I'd be more than happy to add examples of those big numbers to add
> them to our unit tests and confirm round trip works for them.
>
>
> --
> Raúl Marín Rodríguez
> carto.com
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20200420/365a796f/attachment.html>


More information about the postgis-devel mailing list