主页
Python
Python math.copysign() 方法
demo_ref_math_copysign
运行 ❯
×
更改方向
保存代码
更改主题
#Import math Library import math #Return the value of the first parameter and the sign of the second parameter print(math.copysign(4, -1)) print(math.copysign(-8, 97.21)) print(math.copysign(-43, -76))
-4.0
8.0
-43.0