View Source Pythonx.C.PyFloat (Pythonx v0.2.5)
This subtype of PyObject represents a Python floating-point object.
Summary
Functions
Return a C double representation of the contents of pyfloat. If pyfloat is not a Python floating-point object but has a float() method, this method will first be called to convert pyfloat into a float. If float() is not defined then it falls back to index(). This method returns -1.0 upon failure, so one should call PyErr_Occurred() to check for errors.
Return true
if its argument is a PyFloatObject or a subtype of PyFloatObject.
Return true
if its argument is a PyFloatObject, but not a subtype of PyFloatObject. This function always succeeds.
Create a PyFloatObject object from v
, or PyErr.t()
on failure.
Create a PyFloatObject object based on the string value in str
, or PyErr.t()
on failure.
Return a new PyLongObject object from a C size_t
, or nil
on failure.
Return the maximum representable finite float DBL_MAX
as C double
.
Return the minimum normalized positive float DBL_MIN
as C double
.
Functions
@spec as_double(PyObject.t()) :: float() | PyErr.t()
Return a C double representation of the contents of pyfloat. If pyfloat is not a Python floating-point object but has a float() method, this method will first be called to convert pyfloat into a float. If float() is not defined then it falls back to index(). This method returns -1.0 upon failure, so one should call PyErr_Occurred() to check for errors.
@spec check(PyObject.t()) :: boolean()
Return true
if its argument is a PyFloatObject or a subtype of PyFloatObject.
This function always succeeds.
@spec check_exact(PyObject.t()) :: boolean()
Return true
if its argument is a PyFloatObject, but not a subtype of PyFloatObject. This function always succeeds.
This function always succeeds.
@spec from_double(number()) :: PyObject.t() | PyErr.t()
Create a PyFloatObject object from v
, or PyErr.t()
on failure.
Return value: New reference.
@spec from_string(PyObject.t()) :: PyObject.t() | PyErr.t()
Create a PyFloatObject object based on the string value in str
, or PyErr.t()
on failure.
Return value: New reference.
@spec get_info() :: PyObject.t() | PyErr.t()
Return a new PyLongObject object from a C size_t
, or nil
on failure.
Return value: New reference.
@spec get_max() :: float()
Return the maximum representable finite float DBL_MAX
as C double
.
@spec get_min() :: float()
Return the minimum normalized positive float DBL_MIN
as C double
.