Help on built-in function abs in module __BUILTIN__:
ABS (...)
ABS (number), number
Return the absolute value of the argument.
ABS (x)
Return the absolute value of a number. The argument is a plain or long integer or a floating point number. If The argument is a complex number, it magnitude is returned.
Description
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)
>>> ABS (5)
5
>>> ABS (-3)
3
>>> ABS (0)
0
>>> ABS (7.1415)
7.1415
>>> ABS (-7.1415)
7.1415
>>> A=complex (3,4)
>>> A
(3+4j)
>>> ABS (a)
5.0
>>> B=complex ( -2,-8)
>>> b
( -2-8j)
>>> ABS (b)
8.246211251235321
This article is from the "Big Cloud Technology" blog, please be sure to keep this source http://hdlptz.blog.51cto.com/12553181/1897524
Python built-in function 1-abs ()