Issue 1577: shutil.move() where destination is a directory was doing a
[python.git] / Doc / c-api / float.rst
blobbb4f74a35ec5edb1097d70e4cb1a84270655e1aa
1 .. highlightlang:: c
3 .. _floatobjects:
5 Floating Point Objects
6 ----------------------
8 .. index:: object: floating point
11 .. ctype:: PyFloatObject
13    This subtype of :ctype:`PyObject` represents a Python floating point object.
16 .. cvar:: PyTypeObject PyFloat_Type
18    .. index:: single: FloatType (in modules types)
20    This instance of :ctype:`PyTypeObject` represents the Python floating point
21    type.  This is the same object as ``float`` and ``types.FloatType``.
24 .. cfunction:: int PyFloat_Check(PyObject *p)
26    Return true if its argument is a :ctype:`PyFloatObject` or a subtype of
27    :ctype:`PyFloatObject`.
29    .. versionchanged:: 2.2
30       Allowed subtypes to be accepted.
33 .. cfunction:: int PyFloat_CheckExact(PyObject *p)
35    Return true if its argument is a :ctype:`PyFloatObject`, but not a subtype of
36    :ctype:`PyFloatObject`.
38    .. versionadded:: 2.2
41 .. cfunction:: PyObject* PyFloat_FromString(PyObject *str, char **pend)
43    Create a :ctype:`PyFloatObject` object based on the string value in *str*, or
44    *NULL* on failure.  The *pend* argument is ignored.  It remains only for
45    backward compatibility.
48 .. cfunction:: PyObject* PyFloat_FromDouble(double v)
50    Create a :ctype:`PyFloatObject` object from *v*, or *NULL* on failure.
53 .. cfunction:: double PyFloat_AsDouble(PyObject *pyfloat)
55    Return a C :ctype:`double` representation of the contents of *pyfloat*.  If
56    *pyfloat* is not a Python floating point object but has a :meth:`__float__`
57    method, this method will first be called to convert *pyfloat* into a float.
60 .. cfunction:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)
62    Return a C :ctype:`double` representation of the contents of *pyfloat*, but
63    without error checking.
66 .. cfunction:: PyObject* PyFloat_GetInfo(void)
68    Return a structseq instance which contains information about the
69    precision, minimum and maximum values of a float. It's a thin wrapper
70    around the header file :file:`float.h`.
72    .. versionadded:: 2.6
75 .. cfunction:: double PyFloat_GetMax(void)
77    Return the maximum representable finite float *DBL_MAX* as C :ctype:`double`.
79    .. versionadded:: 2.6
82 .. cfunction:: double PyFloat_GetMin(void)
84    Return the minimum normalized positive float *DBL_MIN* as C :ctype:`double`.
86    .. versionadded:: 2.6
89 .. cfunction:: void PyFloat_CompactFreeList(size_t *bc, size_t *bf, size_t *sum)
91    Compact the float free list. *bc* is the number of allocated blocks before
92    blocks are freed, *bf* is the number of freed blocks and *sum* is the number
93    of remaining objects in the blocks.
95    .. versionadded:: 2.6