Return the value of the first parameter and the sign of the second parameter:
#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))
Try it Yourself » Definition and UsageThe math.copysign()
method returns a float consisting of the value of the first parameter and the sign(+/-) of the second parameter.
float
value, which consists of the value of first parameter, and sign of the second parameter Python Version: 2.6
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4