Convert a string or number to a floating point number, if possible.
|
|
|
|
|
__coerce__(x,
y)
coerce(x, y) |
|
|
|
|
|
__divmod__(x,
y)
divmod(x, y) |
|
|
|
|
|
|
|
|
string
|
__format__(float,
format_spec)
Formats the float according to format_spec. |
|
|
|
|
|
|
string
|
__getformat__(float,
typestr)
You probably don't want to use this function. It exists mainly to be
used in Python's test suite. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a new object with type S, a subtype of T
|
|
|
|
|
|
|
__pow__(x,
y,
z=...)
pow(x, y[, z]) |
|
|
|
|
|
|
|
__rdivmod__(x,
y)
divmod(y, x) |
|
|
|
|
|
|
|
|
|
|
|
__rpow__(y,
x,
z=...)
pow(x, y[, z]) |
|
|
|
|
|
|
None
|
__setformat__(float,
typestr,
fmt)
You probably don't want to use this function. It exists mainly to be
used in Python's test suite. |
|
|
|
|
|
|
|
|
|
__trunc__(...)
Return the Integral closest to x between 0 and x. |
|
|
(int, int)
|
as_integer_ratio(float)
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. |
|
|
|
conjugate(...)
Return self, the complex conjugate of any float. |
|
|
float
|
fromhex(float,
string)
Create a floating-point number from a hexadecimal string.
>>> float.fromhex('0x1.ffffp10')
2047.984375
>>> float.fromhex('-0x1p-1074')
-4.9406564584124654e-324 |
|
|
string
|
hex(float)
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. |
|
|
Inherited from object :
__delattr__ ,
__init__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|