Changeset 391 for python/trunk/Doc/c-api/float.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/c-api/float.rst
r2 r391 9 9 10 10 11 .. c type:: PyFloatObject11 .. c:type:: PyFloatObject 12 12 13 This subtype of :c type:`PyObject` represents a Python floating point object.13 This subtype of :c:type:`PyObject` represents a Python floating point object. 14 14 15 15 16 .. c var:: PyTypeObject PyFloat_Type16 .. c:var:: PyTypeObject PyFloat_Type 17 17 18 18 .. index:: single: FloatType (in modules types) 19 19 20 This instance of :c type:`PyTypeObject` represents the Python floating point20 This instance of :c:type:`PyTypeObject` represents the Python floating point 21 21 type. This is the same object as ``float`` and ``types.FloatType``. 22 22 23 23 24 .. c function:: int PyFloat_Check(PyObject *p)24 .. c:function:: int PyFloat_Check(PyObject *p) 25 25 26 Return true if its argument is a :c type:`PyFloatObject` or a subtype of27 :c type:`PyFloatObject`.26 Return true if its argument is a :c:type:`PyFloatObject` or a subtype of 27 :c:type:`PyFloatObject`. 28 28 29 29 .. versionchanged:: 2.2 … … 31 31 32 32 33 .. c function:: int PyFloat_CheckExact(PyObject *p)33 .. c:function:: int PyFloat_CheckExact(PyObject *p) 34 34 35 Return true if its argument is a :c type:`PyFloatObject`, but not a subtype of36 :c type:`PyFloatObject`.35 Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype of 36 :c:type:`PyFloatObject`. 37 37 38 38 .. versionadded:: 2.2 39 39 40 40 41 .. c function:: PyObject* PyFloat_FromString(PyObject *str, char **pend)41 .. c:function:: PyObject* PyFloat_FromString(PyObject *str, char **pend) 42 42 43 Create a :c type:`PyFloatObject` object based on the string value in *str*, or43 Create a :c:type:`PyFloatObject` object based on the string value in *str*, or 44 44 *NULL* on failure. The *pend* argument is ignored. It remains only for 45 45 backward compatibility. 46 46 47 47 48 .. c function:: PyObject* PyFloat_FromDouble(double v)48 .. c:function:: PyObject* PyFloat_FromDouble(double v) 49 49 50 Create a :c type:`PyFloatObject` object from *v*, or *NULL* on failure.50 Create a :c:type:`PyFloatObject` object from *v*, or *NULL* on failure. 51 51 52 52 53 .. c function:: double PyFloat_AsDouble(PyObject *pyfloat)53 .. c:function:: double PyFloat_AsDouble(PyObject *pyfloat) 54 54 55 Return a C :c type:`double` representation of the contents of *pyfloat*. If55 Return a C :c:type:`double` representation of the contents of *pyfloat*. If 56 56 *pyfloat* is not a Python floating point object but has a :meth:`__float__` 57 57 method, this method will first be called to convert *pyfloat* into a float. 58 This method returns ``-1.0`` upon failure, so one should call 59 :c:func:`PyErr_Occurred` to check for errors. 58 60 59 61 60 .. c function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)62 .. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat) 61 63 62 Return a C :c type:`double` representation of the contents of *pyfloat*, but64 Return a C :c:type:`double` representation of the contents of *pyfloat*, but 63 65 without error checking. 64 66 65 67 66 .. c function:: PyObject* PyFloat_GetInfo(void)68 .. c:function:: PyObject* PyFloat_GetInfo(void) 67 69 68 70 Return a structseq instance which contains information about the … … 73 75 74 76 75 .. c function:: double PyFloat_GetMax()77 .. c:function:: double PyFloat_GetMax() 76 78 77 Return the maximum representable finite float *DBL_MAX* as C :c type:`double`.79 Return the maximum representable finite float *DBL_MAX* as C :c:type:`double`. 78 80 79 81 .. versionadded:: 2.6 80 82 81 83 82 .. c function:: double PyFloat_GetMin()84 .. c:function:: double PyFloat_GetMin() 83 85 84 Return the minimum normalized positive float *DBL_MIN* as C :c type:`double`.86 Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`. 85 87 86 88 .. versionadded:: 2.6 87 89 88 90 89 .. c function:: int PyFloat_ClearFreeList()91 .. c:function:: int PyFloat_ClearFreeList() 90 92 91 93 Clear the float free list. Return the number of items that could not … … 93 95 94 96 .. versionadded:: 2.6 97 98 99 .. c:function:: void PyFloat_AsString(char *buf, PyFloatObject *v) 100 101 Convert the argument *v* to a string, using the same rules as 102 :func:`str`. The length of *buf* should be at least 100. 103 104 This function is unsafe to call because it writes to a buffer whose 105 length it does not know. 106 107 .. deprecated:: 2.7 108 Use :func:`PyObject_Str` or :func:`PyOS_double_to_string` instead. 109 110 111 .. c:function:: void PyFloat_AsReprString(char *buf, PyFloatObject *v) 112 113 Same as PyFloat_AsString, except uses the same rules as 114 :func:`repr`. The length of *buf* should be at least 100. 115 116 This function is unsafe to call because it writes to a buffer whose 117 length it does not know. 118 119 .. deprecated:: 2.7 120 Use :func:`PyObject_Repr` or :func:`PyOS_double_to_string` instead.
Note:
See TracChangeset
for help on using the changeset viewer.