Float support on interval artihmetics#6048
Float support on interval artihmetics#6048alamb merged 19 commits intoapache:mainfrom synnada-ai:feature/float-support-on-interval-arith
Conversation
mustafasrepo
left a comment
There was a problem hiding this comment.
This PR is passed from our internal review process. It is LGTM!. By implementing test cases as macro, coverage of the tests in the cp_solver.rs is increased. Also once standart rust supports next up, next down routines for floating point numbers, rounding.rs file can be removed.
alamb
left a comment
There was a problem hiding this comment.
Seems reasonable to me - Today I learned about how to make a floating point value "just slightly larger" than another 👍
Thanks @metesynnada and @mustafasrepo -- I am on a break this week so I apologize for the delay in reviewing / merging. I also really appreciate the work to unify the interval logic
| right_interval: (Option<i32>, Option<i32>), | ||
| left_expected: (Option<i32>, Option<i32>), | ||
| right_expected: (Option<i32>, Option<i32>), | ||
| left_interval: Interval, |
| /// let next_f = next_up(f); | ||
| /// assert_eq!(next_f, 1.0000001); | ||
| /// ``` | ||
| #[allow(dead_code)] |
There was a problem hiding this comment.
It is strange the "dead code" annotation is still needed
Which issue does this PR close?
Closes #5974.
Rationale for this change
This PR adds support for
Float32andFloat64interval arithmetic, ensuring reliability and accuracy in computations by controlling rounding modes as per the IEEE 754 floating-point standard.What changes are included in this PR?
Float32andFloat64interval arithmeticnext_upandnext_downfunctions forf32andf64, which will be replaced by Rust's built-in functions once the unstable feature becomes stable and the tracking issue for the unstable Rust feature (Tracking Issue forfloat_next_up_downrust-lang/rust#91399)Are these changes tested?
Float32andFloat64interval arithmetic operations, including custom next_up and next_down functionsAre there any user-facing changes?
Users will now be able to use
Float32andFloat64in interval arithmetic, meaning that executors using the interval library now support float operations.