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