Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. /* Complex number structure */
  2. #ifndef Py_COMPLEXOBJECT_H
  3. #define Py_COMPLEXOBJECT_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct {
  8. double real;
  9. double imag;
  10. } Py_complex;
  11. /* Operations on complex numbers from complexmodule.c */
  12. #define c_sum _Py_c_sum
  13. #define c_diff _Py_c_diff
  14. #define c_neg _Py_c_neg
  15. #define c_prod _Py_c_prod
  16. #define c_quot _Py_c_quot
  17. #define c_pow _Py_c_pow
  18. PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex);
  19. PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex);
  20. PyAPI_FUNC(Py_complex) c_neg(Py_complex);
  21. PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex);
  22. PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
  23. PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
  24. /* Complex object interface */
  25. /*
  26. PyComplexObject represents a complex number with double-precision
  27. real and imaginary parts.
  28. */
  29. typedef struct {
  30. PyObject_HEAD
  31. Py_complex cval;
  32. } PyComplexObject;
  33. PyAPI_DATA(PyTypeObject) PyComplex_Type;
  34. #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
  35. #define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type)
  36. PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
  37. PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
  38. PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
  39. PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
  40. PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* !Py_COMPLEXOBJECT_H */