ID EN
Math

copysign

Python 3.11

Return a float with the magnitude (absolute value) of x but the sign of y. On platforms that support signed zeros, copysign(1.0, -0.0) returns -1.0.

Syntax

PYTHON
math.copysign(x, y)