Mojo function
copysign
copysign[dtype: DType, width: Int, //](magnitude: SIMD[dtype, width], sign: SIMD[dtype, width]) -> SIMD[dtype, width]
Returns a value with the magnitude of the first operand and the sign of the second operand.
Constraints:
The type of the input must be numeric.
Parameters:
- βdtype (
DType): Thedtypeof the input and output SIMD vector. - βwidth (
Int): The width of the input and output SIMD vector.
Args:
Returns:
SIMD: Copies the sign from sign to magnitude.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!