1991-02-19 13:39:46 +01:00
|
|
|
|
1990-10-14 13:07:46 +01:00
|
|
|
/* Float object interface */
|
|
|
|
|
|
|
|
/*
|
1995-01-12 12:45:45 +01:00
|
|
|
PyFloatObject represents a (double precision) floating point number.
|
1990-10-14 13:07:46 +01:00
|
|
|
*/
|
|
|
|
|
2000-07-09 02:20:36 +02:00
|
|
|
#ifndef Py_FLOATOBJECT_H
|
|
|
|
#define Py_FLOATOBJECT_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1990-10-14 13:07:46 +01:00
|
|
|
typedef struct {
|
2000-07-09 02:20:36 +02:00
|
|
|
PyObject_HEAD
|
|
|
|
double ob_fval;
|
1995-01-12 12:45:45 +01:00
|
|
|
} PyFloatObject;
|
1990-10-14 13:07:46 +01:00
|
|
|
|
1995-02-27 11:17:52 +01:00
|
|
|
extern DL_IMPORT(PyTypeObject) PyFloat_Type;
|
1990-10-14 13:07:46 +01:00
|
|
|
|
1995-01-12 12:45:45 +01:00
|
|
|
#define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
|
1990-10-14 13:07:46 +01:00
|
|
|
|
2000-07-09 02:20:36 +02:00
|
|
|
extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char**);
|
|
|
|
extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double);
|
|
|
|
extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *);
|
1990-10-14 13:07:46 +01:00
|
|
|
|
|
|
|
/* Macro, trading safety for speed */
|
1997-08-02 04:40:58 +02:00
|
|
|
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
|
1993-07-28 11:05:47 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_FLOATOBJECT_H */
|