English documents:
ABS (x)
Return the absolute value of a number. The argument is a integer or a floating point number. If The argument is a complex number, it magnitude is returned
Description
1. Returns the absolute value of a number, which can be an integer, floating-point, or plural
2. If the argument is a complex number, this method returns the absolute value of this complex number (the square root of the product of the complex number and its conjugate complex number)
Example:
>>>Help (ABS)-on built-inchFunction absinchmodule Builtins:abs (x,/) Return The absolute value of the argument.>>> ABS (2)#positive integers2>>> ABS (-2)#Negative integer2>>> ABS (0)#00>>> ABS (2.3)#positive floating point number2.3>>> ABS (-2.3)#Negative floating point number2.3>>> C1 = Complex ()>>> C1#plural(1+1j)>>> ABS (C1)#Absolute Numbers1.4142135623730951>>> C2 = Complex ( -1,-1)>>> C2#plural( -1-1j)>>> ABS (C2)#Absolute Numbers1.4142135623730951>>>
Python built-in functions (1)--abs