https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119241

--- Comment #24 from Robert Dubner <rdubner at gcc dot gnu.org> ---
Here comes perhaps too much information.

That "value thing" was added late.  I believe it arrived at the point where Jim
realized he needed to be doing compile-time numerical calculations for the
Compiler Directing Facility (e.g.:  >>IF CVAL > 2 ), and so then he decided to
use it for all such calculations, like establishing initial values of
variables, and for establishing the values of literals.

In the case of numerical literals, I rework the data.initial member to become
the formatted string that will be output by a "DISPLAY <that_literal>"
statement.

That's the code you have encountered here.  There is no specification for the
DISPLAY statement's output.  So, for floating-point numbers, I chose to use E
notation when the exponent is >=7 or <=-6.  For numbers inside that range, I
format it as fixed point.

That's both to avoid 2E1 and 0E0 (which I personally detest), and to avoid
numbers like 99999999 and 0.00000001, where you have to start counting digits
to figure out the magnitude.  In between I create a fixed-point display out of
the float.

So, yeah, since real_to_decimal isn't like strfromf128, that code needs to be
reworked.  

Do you want me to rework that code?  I am not sure how to go about patching a
patched patch.

Or shall I continue the testcase effort?  We were lucky, just pure luck, that
one of the dozen or so routines I converted happened to cover this.

Reply via email to