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

--- Comment #7 from Jan Schultke <janschultke at googlemail dot com> ---

> What you're actually seeing here is the uninitialized value of x.
> It's not being set to +0.0f it's just not being set at all.
> You didn't check whether from_chars actually succeeded.
>
> I think libstdc++ conforms to the standard,
> but https://cplusplus.github.io/LWG/issue3081 might be a better approach.

You seem to be misreading the example.

"-1e-1000" is not an example of overflow, but of floating-point underflow.
Before LWG3081, the resulting tiny value would have been in the range of
representable values, so a value is written. After LWG3081, this is not an
example of overflow, so a value is written. Either way, a value ought to be
written, and LWG3081 is irrelevant.

If std::from_chars doesn't succeed in parsing "-1e-1000", that's an even bigger
bug than merely not setting the sign bit properly.

Reply via email to