float.pxd 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. cdef extern from "Python.h":
  2. ############################################################################
  3. # 7.2.3
  4. ############################################################################
  5. # PyFloatObject
  6. #
  7. # This subtype of PyObject represents a Python floating point object.
  8. # PyTypeObject PyFloat_Type
  9. #
  10. # This instance of PyTypeObject represents the Python floating
  11. # point type. This is the same object as float and
  12. # types.FloatType.
  13. bint PyFloat_Check(object p)
  14. # Return true if its argument is a PyFloatObject or a subtype of
  15. # PyFloatObject.
  16. bint PyFloat_CheckExact(object p)
  17. # Return true if its argument is a PyFloatObject, but not a
  18. # subtype of PyFloatObject.
  19. object PyFloat_FromString(object str, char **pend)
  20. # Return value: New reference.
  21. # Create a PyFloatObject object based on the string value in str,
  22. # or NULL on failure. The pend argument is ignored. It remains
  23. # only for backward compatibility.
  24. object PyFloat_FromDouble(double v)
  25. # Return value: New reference.
  26. # Create a PyFloatObject object from v, or NULL on failure.
  27. double PyFloat_AsDouble(object pyfloat) except? -1
  28. # Return a C double representation of the contents of pyfloat.
  29. double PyFloat_AS_DOUBLE(object pyfloat)
  30. # Return a C double representation of the contents of pyfloat, but
  31. # without error checking.