Overflow flag when result is larget finite value
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in src/ieee.rs at IeeeFloat::overflow_result and reproduce the provided Quad::largest multiplication with Round::TowardZero. Check the finite-result path and compare its status with the IEEE 754-2019 requirement, including the stated non-infinity case. Done means the result remains the largest finite value while the status includes both OVERFLOW and INEXACT.
Written by the indexing model from the issue text.
Description
IeeeFloat::overflow_result ( in src/ieee.rs) returns Status::INEXACT alone on the finite-result path.
IEEE 754-2019 7.4 requires the overflow whenever the largest finite number is exceeded in magnitude by what would have been the rounded floating point result with an unbounded exponent range.
Whether the default result subsequently produced by the selected rounding mode is infinity or the largest finite value does not change whether overflow occurred.
In particular, the specification details overflow for roundTowardZero and roundTowardNegative even with a non inf result.
use rustc_apfloat::ieee::Quad;
use rustc_apfloat::{Float, Round, Status, StatusAnd};
fn main() {
let x = Quad::largest();
let StatusAnd { status, value } = x.mul_r(x, Round::TowardZero);
println!("value : {value:?}");
println!("status: {status:?}");
}
Observed:
value : 1.18973149535723176508575932662800702E+4932(Normal | +[10384593717069655257060992658440191] * 2^16383)
status: Status(INEXACT)
Expected:
value : 1.18973149535723176508575932662800702E+4932(Normal | +[10384593717069655257060992658440191] * 2^16383)
status: Status(OVERFLOW | INEXACT)
This is related to the following LLVM issue: https://github.com/llvm/llvm-project/issues/220018
- Dominant language
- Rust
- Stars
- 23
- Forks
- 16
- Avg merge
- 6h 52m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rustc_apfloat
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
rust-lang/rustc_apfloat#20 ·
-
Support squareRoot Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-lang/rustc_apfloat#14 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
rust-lang/rustc_apfloat#10 · 7 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in rust-lang/rustc_apfloat
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100