-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the generic algorithm to make these two functions available whenever `f16_enabled` or `f128_enabled` are true. These require the `unstable` feature.
- Loading branch information
Showing
6 changed files
with
67 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Sign of Y, magnitude of X (f32) | ||
/// | ||
/// Constructs a number with the magnitude (absolute value) of its | ||
/// first argument, `x`, and the sign of its second argument, `y`. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn copysignf128(x: f128, y: f128) -> f128 { | ||
super::generic::copysign::copysign(x, y) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Sign of Y, magnitude of X (f32) | ||
/// | ||
/// Constructs a number with the magnitude (absolute value) of its | ||
/// first argument, `x`, and the sign of its second argument, `y`. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn copysignf16(x: f16, y: f16) -> f16 { | ||
super::generic::copysign::copysign(x, y) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// Absolute value (magnitude) of a `f128` value. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn fabsf128(x: f128) -> f128 { | ||
super::generic::abs::abs(x) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// Absolute value (magnitude) of a `f16` value. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn fabsf16(x: f16) -> f16 { | ||
super::generic::abs::abs(x) | ||
} |
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