About
Contact
QtCreator
KDevelop
Solarized
1
use
super
::
super
::
Float
;
2
3
/// Copy the sign of `y` to `x`.
4
#[
inline
]
5
pub
fn
copysign
<F:
Float
>(
x
: F,
y
: F) -> F {
6
let
mut
ux
:
::Int
=
x
.
to_bits
();
7
let
uy
:
::Int
=
y
.
to_bits
();
8
ux
&= !F::SIGN_MASK;
9
ux
|=
uy
& F::SIGN_MASK;
10
F::
from_bits
(
ux
)
11
}
12