Re: Ryu floating point output patch

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: "pgsql-hackers\(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Donald Dong <xdong(at)csumb(dot)edu>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chapman Flack <chap(at)anastigmatix(dot)net>
Subject: Re: Ryu floating point output patch
Date: 2019-01-18 10:03:29
Message-ID: 875zumi9k0.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Next version.

Changes since previous patch:

1. Remove "ryu_" from the name of interface functions; it seems better
to name them according to functionality rather than enshrining the
algorithm name. double_to_shortest_decimal*() and
float_to_shortest_decimal*() are the new names. common/ryu.h renamed
to common/shortest_dec.h accordingly.

2. Revert the removal of upstream's declaration-after-statements, and
add makefile foo to compile without warning about same. Other style
aspects (indentation, comments) still follow our style rather than
upstream's.

3. This patch _includes_ the strtof() patch that was also posted
separately; this is because we need accurate float4in in order to get
round-trip conversions to work for the edge case.

4. Passes regression tests (existing tests either by changing the
output, where the result is reasonably expected to be bit-exact; or by
locally setting extra_float_digits=0 to restore the old output, where
the output is not expected to be bit-exact).

Still to be done: docs, which are still waiting on final decisions on
the questions I asked upthread.

--
Andrew (irc:RhodiumToad)

Attachment Content-Type Size
ryu6.patch text/x-patch 262.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2019-01-18 10:05:53 Re: Ryu floating point output patch
Previous Message Vik Fearing 2019-01-18 09:50:29 Re: Prepare Transaction support for ON COMMIT DROP temporary tables