home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / FLOATOBJECT.H < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-01  |  753 b   |  34 lines

  1.  
  2. /* Float object interface */
  3.  
  4. /*
  5. PyFloatObject represents a (double precision) floating point number.
  6. */
  7.  
  8. #ifndef Py_FLOATOBJECT_H
  9. #define Py_FLOATOBJECT_H
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14. typedef struct {
  15.     PyObject_HEAD
  16.     double ob_fval;
  17. } PyFloatObject;
  18.  
  19. extern DL_IMPORT(PyTypeObject) PyFloat_Type;
  20.  
  21. #define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
  22.  
  23. extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char**);
  24. extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double);
  25. extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *);
  26.  
  27. /* Macro, trading safety for speed */
  28. #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
  29.  
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* !Py_FLOATOBJECT_H */
  34.