HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Math Methods : Return absolute value
The math.fabs()
method returns the absolute value of a number, as a float.
Absolute denotes a non-negative number. This removes the negative sign of the value if it has any.
Unlike Python abs(), this method always converts the value to a float value.
Parameter | Description |
---|---|
x | Required. A number. If we try anything else except a number, it returns a TypeError |
Return Value: | A float value, representing the absolute value
of x |
---|---|
Python Version: | 2.6 |