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_fabs.asp below:

Website Navigation


Python math.fabs() Method

Python math.fabs() Method

❮ Math Methods

Example

Return absolute value:

#Import math Library

import math

#Print absolute values from numbers

print(math.fabs(-66.43))

print(math.fabs(-7))

Try it Yourself » Definition and Usage

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.

Syntax Parameter Values Parameter Description x Required. A number. If we try anything else except a number, it returns a TypeError Technical Details Return Value: A float value, representing the absolute value of x 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