[postgis-devel] Proposal for sensible number output semantics

rmrodriguez at carto.com rmrodriguez at carto.com
Mon Apr 20 09:12:19 PDT 2020


There is still quite a bit of testing to be done, but I have a initial
implementation here:
https://github.com/Algunenano/postgis/tree/shortest, with some tests
in https://github.com/Algunenano/postgis/blob/3e2326976e349e38d94cc05a28c204d54205011e/liblwgeom/cunit/cu_print.c#L269

Since I've had to write a new function in ryu (to_chars_fixed_point) I
expect some errors to show up during testing (specially around the
rounding or the handling of leading decimal zeros) and I still have to
bring some of the optimizations to that code (fast print for integers
for example).
Once things are more tested, I'll clear the commits and make more
clear what are the changes done to Ryu's d2s.c (which is a new file
I've introduced from the upstream tree).

Any comment or suggestions are more than welcome!

On Mon, Apr 20, 2020 at 3:11 PM <rmrodriguez at carto.com> wrote:
>
> > Can you provide a set of examples (AKA unit tests)?  Then we can all see how it works.
>
> Yes, the idea is to have unit tests for lwprint_double to control and
> showcase how the shortest representation works and the impact /
> rounding due to the precision parameter.
>
> --
> Raúl Marín Rodríguez
> carto.com



-- 
Raúl Marín Rodríguez
carto.com


More information about the postgis-devel mailing list