On 4/5/24 10:47 AM, Jerry D wrote: > On 4/4/24 2:41 PM, Tobias Burnus wrote: >> Hi Jerry, >> >> I think for the current testcases, I like the patch – the question is >> only what's about: >> >>    ',3' as input for 'comma'   (or '.3' as input for 'point') >> >> For 'point' – 0.3 is read and ios = 0 (as expected) >> But for 'comma': >> * GCC 12 reads nothing and has ios = 0. >> * GCC 13/mainline has an error (ios != 0 – and reads nothing) >> * GCC with your patch: Same result: ios != 0 and nothing read. >> >> Expected: Same as with ','/'comma' – namely: read-in value is 0.3. >> → https://godbolt.org/z/4rc8fz4sT for the full example, which works >> with ifort, ifx and flang >> >> * * * >> >> Can you check and fix this? It looks perfectly valid to me to have >> remove the '0' in the floating point numbers '0.3' or '0,3' seems to >> be permitted – and it works for '.' (with 'point') but not for ',' >> (with 'comma'). >> > Yes, I found the spot to fix this. > >> F2023's "13.10.3.1 List-directed input forms" refers to "13.7.2.3.2 F >> editing", which states: >> >> "The standard form of the input field [...] The form of the mantissa >> is an optional sign, followed by a string of one or more digits >> optionally containing a decimal symbol." >> >> The latter does not require that the digit has to be before the >> decimal sign and as for output, it is optional, it is surely intended >> that ",3" is a valid floating-point number for decimal='comma'. >> > > Agree > >> * * * >> >> I extended the testcase to check for this – see attached diff. All >> 'point' work, all 'comma' fail. >> >> Thanks for working on this! >> >> Tobias > > Thanks much. After I fix it, I will use your extended test case in the > test suite. > > Jerry - See attached updated patch. Regressions tested on x86-64. OK for trunk and 13 after a bit. Jerry -