Skip to main content

copysign

Function copysign 

Source
pub fn copysign<T: Real>(a: T, b: T) -> T
Expand description

Copy the sign of b to the magnitude of a.

ยงExamples

use mathverse_core::ops::copysign;

assert_eq!(copysign(3.0, -1.0), -3.0);
assert_eq!(copysign(3.0, 1.0), 3.0);