Skip to content

P3944 Investigate how to handle floating-point underflow #126

@eisenwave

Description

@eisenwave

There are four cases that from_characters may need to handle

  • parsing an exact subnormal result
  • parsing an exact zero
  • parsing an inexact subnormal result
  • parsing an inexact zero

Underflow is signaled for both of the latter cases. It seems fairly clear that an exact subnormal result should be okay, otherwise the round-trip requirement of std::to_chars cannot be satisfied. Exact zero is obviously fine as well.

If both latter cases result in from_characters_status::floating_underflow, it would seem reasonable that the subnormal result is not flushed to zero, so that the user can obtain the value for diagnostic purposes. However, it's not obvious whether this is (easily) implementable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-investigationInvestigation of implementations or other facts is required

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions