copysign (Function)

Signature: copysign(x: t0, y: t0) -> t0

Description: x's magnitude with y's sign. Total; a NaN keeps its payload and takes y's sign bit.

Parameters

  • x (t0): The magnitude
  • y (t0): The sign donor

Returns: t0

Example

print(copysign(3.0, -1.0))  // -3.0
print (copysign (3.0, -1.0))  // -3.0