-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile of float rounding function tests on MSVC and test for NaNs.
I mistakenly thought fesetround() would return the previous mode, but it returns 0 for success. So we need to call fegetround() first to be able to restore the mode. Changing the fp environment does not produce a reliable output in tests so don't do it (no one changes the env anyway).
- Loading branch information
Showing
4 changed files
with
40 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -734,6 +734,9 @@ sus_pure inline _self recip() const& noexcept { | |
/// $sus::num::@doc.self::round_ties) which often makes the latter a better | ||
/// choice. | ||
/// | ||
/// If `self` is a `NaN`, infinity, or zero, the same will be returned, though | ||
/// a different `NaN` may be returned. | ||
/// | ||
/// As in Rust's [`round`]( | ||
/// https://doc.rust-lang.org/stable/std/[email protected]#method.round), | ||
/// this method preserves the sign bit when the result is `-0.0`, but this is | ||
|
@@ -751,6 +754,9 @@ sus_pure inline _self round() const& noexcept { | |
/// However it breaks with the legacy behaviour of [`std::round`]( | ||
/// https://en.cppreference.com/w/cpp/numeric/math/round). | ||
/// | ||
/// If `self` is a `NaN`, infinity, or zero, the same will be returned, though | ||
/// a different `NaN` may be returned. | ||
/// | ||
/// Rust has the unstable [`round_ties_even`]( | ||
/// https://doc.rust-lang.org/stable/std/[email protected]#method.round_ties_even) | ||
/// method that always uses the [`FE_TONEAREST`]( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters