as_integer_ratio() | Returns a tuple with two elements: numerator and denominator |
conjugate() | |
fromhex() | An instance method that creates a float from a hexadecimal representation as returned by hex() |
hex() | |
imag | Always evaluates to 0.0 (See CPython source code for floats, float_getimag). This member seems to be present so that both, floats and complex objects can be passed to a function that evaluates .imag. |
is_integer() | True if the instance is finite and has an integral value. |
real | See imag |
>>> x = 3.141
>>> x.hex()
'0x1.920c49ba5e354p+1'
>>> y = float.fromhex('0x1.920c49ba5e354p+1')
>>> y
3.141
not_a_number = float('NaN')
infinite = float('inf')
int mpmath provides arbitrary precision real and compleas floating-point arithmetics.