<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 17, 2020 at 10:04 AM <<a href="mailto:rmrodriguez@carto.com">rmrodriguez@carto.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On Fri, Apr 17, 2020 at 6:53 PM Martin Davis <<a href="mailto:mtnclimb@gmail.com" target="_blank">mtnclimb@gmail.com</a>> wrote:<br>
> So if you specify say 20 decimal digits, you aren't getting them?  It seems like this at least should be made to work.  It doesn't sound like a bad thing, as long as it doesn't cause *unspecified* precision output to get a lot longer.<br>
<br>
No, I wasn't getting them. The problem, as I mentioned in Github, is<br>
that we don't have a way to distinguish "give me 15 decimal digits" to<br>
"I used the default, which is give me 15 decimal digits", so fixing it<br>
produced many new unexpected digits.<br></blockquote><div><br></div><div>Right, we do need a way to distinguish these two cases.  As I mentioned in PR 554 [1], a way to do this is to change the default value to a sentry value (say -999).  Then the routine can tell if the precision argument was omitted, and use the default behaviour (which for simplicity and backwards compatibility can be the behaviour we have now).  The doc should change to say that this is the default behaviour.</div><div><br></div><div>[1] <a href="https://github.com/postgis/postgis/pull/554#issuecomment-615344280">https://github.com/postgis/postgis/pull/554#issuecomment-615344280</a></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Fri, Apr 17, 2020 at 6:58 PM Martin Davis <<a href="mailto:mtnclimb@gmail.com" target="_blank">mtnclimb@gmail.com</a>> wrote:<br>
> That's assuming that the C FP output works in the correct way. If not, I guess we could implement that Burger's algorithm mentioned - which is what Python does, apparently.  Although is it really worth the complexity?<br>
<br>
For 3.1 I replaced the C FP with ryu printf<br>
(<a href="https://github.com/ulfjack/ryu" rel="noreferrer" target="_blank">https://github.com/ulfjack/ryu</a>) so that's already there. No need to<br>
do anything extra, just remove the differences between functions and<br>
maybe tweak some defaults if necessary.<br></blockquote><div><br></div><div>Ok, that's good. </div></div></div>