A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_math_copysign.asp below:

Website Navigation


Python math.copysign() Method

Python math.copysign() Method

❮ Math Methods

Example

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 Usage

The math.copysign() method returns a float consisting of the value of the first parameter and the sign(+/-) of the second parameter.

Syntax Parameter Values Parameter Description x Required. A number. The return will have the value of this parameter y Required. A number. The return will have the sign (+/-) of this parameter Technical Details Return Value: A float value, which consists of  the value of first parameter, and sign of the second parameter Python Version: 2.6

❮ Math Methods

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