Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/python2....
File: floatobject.h
[0] Fix | Delete
/* Float object interface */
[1] Fix | Delete
[2] Fix | Delete
/*
[3] Fix | Delete
PyFloatObject represents a (double precision) floating point number.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
#ifndef Py_FLOATOBJECT_H
[7] Fix | Delete
#define Py_FLOATOBJECT_H
[8] Fix | Delete
#ifdef __cplusplus
[9] Fix | Delete
extern "C" {
[10] Fix | Delete
#endif
[11] Fix | Delete
[12] Fix | Delete
typedef struct {
[13] Fix | Delete
PyObject_HEAD
[14] Fix | Delete
double ob_fval;
[15] Fix | Delete
} PyFloatObject;
[16] Fix | Delete
[17] Fix | Delete
PyAPI_DATA(PyTypeObject) PyFloat_Type;
[18] Fix | Delete
[19] Fix | Delete
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
[20] Fix | Delete
#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
[21] Fix | Delete
[22] Fix | Delete
/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases,
[23] Fix | Delete
the rounding noise created by various operations is suppressed, while
[24] Fix | Delete
giving plenty of precision for practical use. */
[25] Fix | Delete
[26] Fix | Delete
#define PyFloat_STR_PRECISION 12
[27] Fix | Delete
[28] Fix | Delete
#ifdef Py_NAN
[29] Fix | Delete
#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
[30] Fix | Delete
#endif
[31] Fix | Delete
[32] Fix | Delete
#define Py_RETURN_INF(sign) do \
[33] Fix | Delete
if (copysign(1., sign) == 1.) { \
[34] Fix | Delete
return PyFloat_FromDouble(Py_HUGE_VAL); \
[35] Fix | Delete
} else { \
[36] Fix | Delete
return PyFloat_FromDouble(-Py_HUGE_VAL); \
[37] Fix | Delete
} while(0)
[38] Fix | Delete
[39] Fix | Delete
PyAPI_FUNC(double) PyFloat_GetMax(void);
[40] Fix | Delete
PyAPI_FUNC(double) PyFloat_GetMin(void);
[41] Fix | Delete
PyAPI_FUNC(PyObject *) PyFloat_GetInfo(void);
[42] Fix | Delete
[43] Fix | Delete
/* Return Python float from string PyObject. Second argument ignored on
[44] Fix | Delete
input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
[45] Fix | Delete
purpose once but can't be made to work as intended). */
[46] Fix | Delete
PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*, char** junk);
[47] Fix | Delete
[48] Fix | Delete
/* Return Python float from C double. */
[49] Fix | Delete
PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
[50] Fix | Delete
[51] Fix | Delete
/* Extract C double from Python float. The macro version trades safety for
[52] Fix | Delete
speed. */
[53] Fix | Delete
PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
[54] Fix | Delete
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
[55] Fix | Delete
[56] Fix | Delete
/* Write repr(v) into the char buffer argument, followed by null byte. The
[57] Fix | Delete
buffer must be "big enough"; >= 100 is very safe.
[58] Fix | Delete
PyFloat_AsReprString(buf, x) strives to print enough digits so that
[59] Fix | Delete
PyFloat_FromString(buf) then reproduces x exactly. */
[60] Fix | Delete
PyAPI_FUNC(void) PyFloat_AsReprString(char*, PyFloatObject *v);
[61] Fix | Delete
[62] Fix | Delete
/* Write str(v) into the char buffer argument, followed by null byte. The
[63] Fix | Delete
buffer must be "big enough"; >= 100 is very safe. Note that it's
[64] Fix | Delete
unusual to be able to get back the float you started with from
[65] Fix | Delete
PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to
[66] Fix | Delete
preserve precision across conversions. */
[67] Fix | Delete
PyAPI_FUNC(void) PyFloat_AsString(char*, PyFloatObject *v);
[68] Fix | Delete
[69] Fix | Delete
/* _PyFloat_{Pack,Unpack}{4,8}
[70] Fix | Delete
*
[71] Fix | Delete
* The struct and pickle (at least) modules need an efficient platform-
[72] Fix | Delete
* independent way to store floating-point values as byte strings.
[73] Fix | Delete
* The Pack routines produce a string from a C double, and the Unpack
[74] Fix | Delete
* routines produce a C double from such a string. The suffix (4 or 8)
[75] Fix | Delete
* specifies the number of bytes in the string.
[76] Fix | Delete
*
[77] Fix | Delete
* On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats
[78] Fix | Delete
* these functions work by copying bits. On other platforms, the formats the
[79] Fix | Delete
* 4- byte format is identical to the IEEE-754 single precision format, and
[80] Fix | Delete
* the 8-byte format to the IEEE-754 double precision format, although the
[81] Fix | Delete
* packing of INFs and NaNs (if such things exist on the platform) isn't
[82] Fix | Delete
* handled correctly, and attempting to unpack a string containing an IEEE
[83] Fix | Delete
* INF or NaN will raise an exception.
[84] Fix | Delete
*
[85] Fix | Delete
* On non-IEEE platforms with more precision, or larger dynamic range, than
[86] Fix | Delete
* 754 supports, not all values can be packed; on non-IEEE platforms with less
[87] Fix | Delete
* precision, or smaller dynamic range, not all values can be unpacked. What
[88] Fix | Delete
* happens in such cases is partly accidental (alas).
[89] Fix | Delete
*/
[90] Fix | Delete
[91] Fix | Delete
/* The pack routines write 4 or 8 bytes, starting at p. le is a bool
[92] Fix | Delete
* argument, true if you want the string in little-endian format (exponent
[93] Fix | Delete
* last, at p+3 or p+7), false if you want big-endian format (exponent
[94] Fix | Delete
* first, at p).
[95] Fix | Delete
* Return value: 0 if all is OK, -1 if error (and an exception is
[96] Fix | Delete
* set, most likely OverflowError).
[97] Fix | Delete
* There are two problems on non-IEEE platforms:
[98] Fix | Delete
* 1): What this does is undefined if x is a NaN or infinity.
[99] Fix | Delete
* 2): -0.0 and +0.0 produce the same string.
[100] Fix | Delete
*/
[101] Fix | Delete
PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le);
[102] Fix | Delete
PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le);
[103] Fix | Delete
[104] Fix | Delete
/* Used to get the important decimal digits of a double */
[105] Fix | Delete
PyAPI_FUNC(int) _PyFloat_Digits(char *buf, double v, int *signum);
[106] Fix | Delete
PyAPI_FUNC(void) _PyFloat_DigitsInit(void);
[107] Fix | Delete
[108] Fix | Delete
/* The unpack routines read 4 or 8 bytes, starting at p. le is a bool
[109] Fix | Delete
* argument, true if the string is in little-endian format (exponent
[110] Fix | Delete
* last, at p+3 or p+7), false if big-endian (exponent first, at p).
[111] Fix | Delete
* Return value: The unpacked double. On error, this is -1.0 and
[112] Fix | Delete
* PyErr_Occurred() is true (and an exception is set, most likely
[113] Fix | Delete
* OverflowError). Note that on a non-IEEE platform this will refuse
[114] Fix | Delete
* to unpack a string that represents a NaN or infinity.
[115] Fix | Delete
*/
[116] Fix | Delete
PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le);
[117] Fix | Delete
PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le);
[118] Fix | Delete
[119] Fix | Delete
/* free list api */
[120] Fix | Delete
PyAPI_FUNC(int) PyFloat_ClearFreeList(void);
[121] Fix | Delete
[122] Fix | Delete
/* Format the object based on the format_spec, as defined in PEP 3101
[123] Fix | Delete
(Advanced String Formatting). */
[124] Fix | Delete
PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
[125] Fix | Delete
char *format_spec,
[126] Fix | Delete
Py_ssize_t format_spec_len);
[127] Fix | Delete
[128] Fix | Delete
/* Round a C double x to the closest multiple of 10**-ndigits. Returns a
[129] Fix | Delete
Python float on success, or NULL (with an appropriate exception set) on
[130] Fix | Delete
failure. Used in builtin_round in bltinmodule.c. */
[131] Fix | Delete
PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
[132] Fix | Delete
[133] Fix | Delete
PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out);
[134] Fix | Delete
[135] Fix | Delete
[136] Fix | Delete
#ifdef __cplusplus
[137] Fix | Delete
}
[138] Fix | Delete
#endif
[139] Fix | Delete
#endif /* !Py_FLOATOBJECT_H */
[140] Fix | Delete
[141] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function