• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /// Sign of Y, magnitude of X (f64)
2 ///
3 /// Constructs a number with the magnitude (absolute value) of its
4 /// first argument, `x`, and the sign of its second argument, `y`.
copysign(x: f64, y: f64) -> f645 pub fn copysign(x: f64, y: f64) -> f64 {
6     let mut ux = x.to_bits();
7     let uy = y.to_bits();
8     ux &= (!0) >> 1;
9     ux |= uy & (1 << 63);
10     f64::from_bits(ux)
11 }
12