Python 3.9 is now generally available.

Convert a string or number to a floating point number, if possible.

Inherits From: `expected_type`

`imag` the imaginary part of a complex number
`real` the real part of a complex number

## Methods

### `as_integer_ratio`

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original float and with a positive denominator.

Raise OverflowError on infinities and a ValueError on NaNs.

``````>>> (10.0).as_integer_ratio()
(10, 1)
>>> (0.0).as_integer_ratio()
(0, 1)
>>> (-.25).as_integer_ratio()
(-1, 4)
``````

### `conjugate`

Return self, the complex conjugate of any float.

### `fromhex`

Create a floating-point number from a hexadecimal string.

``````>>> float.fromhex('0x1.ffffp10')
2047.984375
>>> float.fromhex('-0x1p-1074')
-5e-324
``````

### `hex`

Return a hexadecimal representation of a floating-point number.

``````>>> (-0.1).hex()
'-0x1.999999999999ap-4'
>>> 3.14159.hex()
'0x1.921f9f01b866ep+1'
``````

### `is_integer`

Return True if the float is an integer.

abs(self)

### `__add__`

Return self+value.

self != 0

### `__eq__`

Return self==value.

### `__floordiv__`

Return self//value.

### `__ge__`

Return self>=value.

### `__gt__`

Return self>value.

### `__le__`

Return self<=value.

### `__lt__`

Return self<value.

### `__mod__`

Return self%value.

### `__mul__`

Return self*value.

### `__ne__`

Return self!=value.

-self

+self

### `__pow__`

Return pow(self, value, mod).

### `__radd__`

Return value+self.

### `__rfloordiv__`

Return value//self.

### `__rmod__`

Return value%self.

### `__rmul__`

Return value*self.

### `__rpow__`

Return pow(value, self, mod).

### `__rsub__`

Return value-self.

### `__rtruediv__`

Return value/self.

### `__sub__`

Return self-value.

### `__truediv__`

Return self/value.

[{ "type": "thumb-down", "id": "hardToUnderstand", "label":"Hard to understand" },{ "type": "thumb-down", "id": "incorrectInformationOrSampleCode", "label":"Incorrect information or sample code" },{ "type": "thumb-down", "id": "missingTheInformationSamplesINeed", "label":"Missing the information/samples I need" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]