[Bug modula2/115164] floating-point output generates misleading values with WriteFloat when sigfigs and width are zero

2024-05-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115164

--- Comment #2 from GCC Commits  ---
The master branch has been updated by Gaius Mulley :

https://gcc.gnu.org/g:d642b66a298ece7394e786a6a2d14a4f0b561d9a

commit r15-700-gd642b66a298ece7394e786a6a2d14a4f0b561d9a
Author: Gaius Mulley 
Date:   Tue May 21 01:11:48 2024 +0100

PR modula2/115164 initial test code highlighting the problem

This patch includes some trivial testcode which highlights
PR 115164.  Expect future test code to perform runtime checks
for a series of trailing zeros.

gcc/testsuite/ChangeLog:

PR modula2/115164
* gm2/isolib/run/pass/testlowread.mod: New test.
* gm2/isolib/run/pass/testwritereal.mod: New test.

Signed-off-by: Gaius Mulley 

[Bug modula2/115164] floating-point output generates misleading values with WriteFloat when sigfigs and width are zero

2024-05-20 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115164

Gaius Mulley  changed:

   What|Removed |Added

   Last reconfirmed||2024-05-20
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Gaius Mulley  ---
Confirmed.

Using the Matula and Goldberg formulas makes much more sense than the current
default output for width 0.  I'll add these formulas to LowReal, LowShortReal,
LowLongReal (there is already a constant 'places', which looks as if it is
incorrect).

gcc/m2/gm2-gcc/m2builtins.cc:597:doplaces: looks wrong.  A Matula value
for sigfigs should be adopted in SRealIO and friends (if the width and sigfigs
are 0).