Pelokalan
Python ID
id en
Masuk
Proyek
c-api__complex.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Complex Number Objects
Objek Bilangan Kompleks
This subtype of :c:type:`PyObject` represents a Python complex number object.
The complex number value, using the C :c:type:`Py_complex` representation.
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex` to convert a Python complex number to/from the C :c:type:`Py_complex` representation.
This instance of :c:type:`PyTypeObject` represents the Python complex number type. It is the same object as :class:`complex` in the Python layer.
If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to call :c:func:`PyFloat_AsDouble` and returns its result.
If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on success.
This C structure defines an export format for a Python complex number object.
Create a new Python complex number object from a C :c:type:`Py_complex` value. Return ``NULL`` with an exception set on error.
Return the :c:type:`Py_complex` value of the complex number *op*.
If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`.
Complex Numbers as C Structures
Bilangan Kompleks sebagai Struktur C
The API also provides functions for working with complex numbers, using the :c:type:`Py_complex` representation. Note that the functions which accept these structures as parameters and return them as results do so *by value* rather than dereferencing them through pointers.
Return the sum of two complex numbers, using the C :c:type:`Py_complex` representation.
Return the difference between two complex numbers, using the C :c:type:`Py_complex` representation.
Return the negation of the complex number *num*, using the C :c:type:`Py_complex` representation.
Return the product of two complex numbers, using the C :c:type:`Py_complex` representation.
Return the quotient of two complex numbers, using the C :c:type:`Py_complex` representation.
Return the absolute value of the complex number *num*.
complex number
bilangan kompleks