Skip to content

Give an overflow the largest finite value in the modes which ask for it - #1460

Merged
mborland merged 1 commit into
boostorg:developfrom
ibmibmibm:overflow-mode
Sep 19, 2026
Merged

mborland merged 1 commit into
boostorg:developfrom
ibmibmibm:overflow-mode

Conversation

@ibmibmibm

Copy link
Copy Markdown
Contributor
  • IEEE 754-2019 7.4: an overflow is the largest finite value in the toward zero mode,
    and in the directed mode which points at zero for the sign. Every type gave an
    infinity in every mode.
  • A new helper reads the mode, and each constructor packs the largest finite value in
    place of the infinity when the helper says so.
  • The float constructors of the three IEEE types had their own overflow check, which
    lost the sign. They now take the same path as the fast types.

Fixes #1459

@ibmibmibm
ibmibmibm marked this pull request as ready for review September 17, 2026 15:54
@ibmibmibm

Copy link
Copy Markdown
Contributor Author

It seems that ddadd81520, ddadd81521, ddadd81621, and ddadd81720 in ddAdd.decTest need to be updated with their commented-out lines. Should I open a PR against cppalliance/decimal-dectest?

@mborland

Copy link
Copy Markdown
Member

It seems that ddadd81520, ddadd81521, ddadd81621, and ddadd81720 in ddAdd.decTest need to be updated with their commented-out lines. Should I open a PR against cppalliance/decimal-dectest?

Yes. Dec test is hosted separately due to license incompatibility.

- IEEE 754-2019 7.4: an overflow is the largest finite value in the toward zero mode,
  and in the directed mode which points at zero for the sign. Every type gave an
  infinity in every mode.
- A new helper reads the mode, and each constructor packs the largest finite value in
  place of the infinity when the helper says so.
- The float constructors of the three IEEE types had their own overflow check, which
  lost the sign. They now take the same path as the fast types.

Fixes boostorg#1459

@mborland mborland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

@mborland
mborland merged commit 628546d into boostorg:develop Sep 19, 2026
67 of 82 checks passed
@ibmibmibm
ibmibmibm deleted the overflow-mode branch September 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An overflow gives an infinity in the modes which ask for the largest finite value

2 participants