Mojo function
copysign
copysign[type: DType, simd_width: Int, //](magnitude: SIMD[type, simd_width], sign: SIMD[type, simd_width]) -> SIMD[type, simd_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:
- type (
DType
): Thedtype
of the input and output SIMD vector. - simd_width (
Int
): The width of the input and output SIMD vector.
Args:
- magnitude (
SIMD[type, simd_width]
): The magnitude to use. - sign (
SIMD[type, simd_width]
): The sign to copy.
Returns:
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!