draft patch for strtof()
От | Andrew Gierth |
---|---|
Тема | draft patch for strtof() |
Дата | |
Msg-id | 87d0owlqpv.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
Ответы |
Re: draft patch for strtof()
Re: draft patch for strtof() |
Список | pgsql-hackers |
As discussed in the Ryu thread, herewith a draft of a patch to use strtof() for float4 input (rather than using strtod() with its double-rounding issue). An exhaustive search shows that this does not change the resulting bit-pattern for any input string that could have been generated by PG with extra_float_digits=3 set. The risk is that values generated by other software, especially code that uses shortest-exact float output (as a number of languages seem to do, and which PG will do if the Ryu patch goes in) will be incorrectly input; though it appears that only one value (7.038531e-26) is both a possible shortest-exact representation and a rounding error (though a number of other values round incorrectly, they are not shortest representations). This includes a fallback to use strtod() the old way if the platform lacks strtof(). A variant file for the new regression tests is needed for such platforms; I've taken a stab at setting this up for the one platform we know will need it (if there are others, the buildfarm will let us know in due course). -- Andrew (irc:RhodiumToad)
Вложения
В списке pgsql-hackers по дате отправления: