On Sun, 5 Sep 2021, Patrick Northon via Mingw-w64-public wrote:

Hi, here's a patch to fix another problem with formatting long doubles in
hexadecimal. I found a failing case with a denormalized value:

Thanks for the patch and testcase!

Git didn't manage to automatically apply your patch and neither did patch(1), but after applying it manually, I could confirm that it fixes the problem.

(The patch had a bit funky indentation in a few places where the source uses tabs - I see that your editor treats tabs as 4 spaces, while the source is written to have them equal 8 spaces. I sent a patch to expand the tabs to spaces in the whole file, to make it easier to work on for everybody.)


But I feel a little uneasy about the patch - why would we unconditionally do a "value.__pformat_fpreg_exponent -= 3;" at the start of __pformat_emit_xfloat? I don't see the corresponding adjustment in __pformat_xldouble for cases where the exponent originally is nonzero (where we just do "z.__pformat_fpreg_exponent -= 0x3FFF;"). I do see that it does work as normal floats do get printed correctly though.

Can the handling be confined to a codepath specifically for denormals somewhere?

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to