Skip to content

Overflow when rounding delivers the largest finite value - #37

Open
Garfield1002 wants to merge 2 commits into
rust-lang:mainfrom
Garfield1002:main
Open

Garfield1002 wants to merge 2 commits into
rust-lang:mainfrom
Garfield1002:main

Conversation

@Garfield1002

Copy link
Copy Markdown

Fixes: #36

IEEE 754 raises the overflow exception whenever the largest finite number
is exceeded in magnitude by the result unbounded exponent range would have
produced, whichever value the rounding mode then delivers. Rounding toward
zero delivers the largest finite number rather than infinity, and
`overflow_result` reported only the inexact result for that case.

This mirrored LLVM's `handleOverflow`, which has the same omission, so the
expectations that encoded it are updated alongside. Consumers that check
the flag - x87 emulation, where hardware raises OE - could not otherwise
distinguish an overflow from an ordinary inexact result: both deliver the
largest finite value.
@tgross35

Copy link
Copy Markdown
Member

Thanks for putting this together! I'm going to hold off and wait for the LLVM fix to go through

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.

Overflow flag when result is larget finite value

2 participants