|
Dynamic Complex Library 1.0.0
Reference-counted arbitrary precision complex number library (MIT OR Unlicense)
|
Functions for Gaussian integers (complex numbers with integer components) More...
Functions | |
| dc_complex_int | dc_int_from_ints (int64_t real, int64_t imag) |
| Create a Gaussian integer from int64_t real and imaginary parts. | |
| dc_complex_int | dc_int_from_di (di_int real, di_int imag) |
| Create a Gaussian integer from dynamic integer components. | |
| dc_complex_int | dc_int_zero (void) |
| Get the Gaussian integer zero (0 + 0i) | |
| dc_complex_int | dc_int_one (void) |
| Get the Gaussian integer one (1 + 0i) | |
| dc_complex_int | dc_int_i (void) |
| Get the Gaussian integer i (0 + 1i) | |
| dc_complex_int | dc_int_neg_one (void) |
| Get the Gaussian integer -1 (-1 + 0i) | |
| dc_complex_int | dc_int_neg_i (void) |
| Get the Gaussian integer -i (0 - 1i) | |
| dc_complex_int | dc_int_retain (dc_complex_int c) |
| Increment reference count and return the same object. | |
| void | dc_int_release (dc_complex_int *c) |
| Decrement reference count and possibly free memory. | |
| dc_complex_int | dc_int_copy (dc_complex_int c) |
| Create a new copy with reference count 1. | |
| dc_complex_int | dc_int_add (dc_complex_int a, dc_complex_int b) |
| Add two Gaussian integers. | |
| dc_complex_int | dc_int_sub (dc_complex_int a, dc_complex_int b) |
| Subtract two Gaussian integers. | |
| dc_complex_int | dc_int_mul (dc_complex_int a, dc_complex_int b) |
| Multiply two Gaussian integers. | |
| dc_complex_frac | dc_int_div (dc_complex_int a, dc_complex_int b) |
| Divide two Gaussian integers (returns exact rational result) | |
| dc_complex_int | dc_int_negate (dc_complex_int c) |
| Negate a Gaussian integer. | |
| dc_complex_int | dc_int_conj (dc_complex_int c) |
| Complex conjugate of a Gaussian integer. | |
| di_int | dc_int_real (dc_complex_int c) |
| Get the real part of a Gaussian integer. | |
| di_int | dc_int_imag (dc_complex_int c) |
| Get the imaginary part of a Gaussian integer. | |
| bool | dc_int_eq (dc_complex_int a, dc_complex_int b) |
| Test if two Gaussian integers are equal. | |
| bool | dc_int_is_zero (dc_complex_int c) |
| Test if a Gaussian integer is zero. | |
| bool | dc_int_is_real (dc_complex_int c) |
| Test if a Gaussian integer is real (imaginary part is zero) | |
| bool | dc_int_is_imag (dc_complex_int c) |
| Test if a Gaussian integer is purely imaginary (real part is zero) | |
| char * | dc_int_to_string (dc_complex_int c) |
| Convert Gaussian integer to mathematical string representation. | |
Functions for Gaussian integers (complex numbers with integer components)
|
extern |
Add two Gaussian integers.
| a | First operand (must not be NULL) |
| b | Second operand (must not be NULL) |
|
extern |
Complex conjugate of a Gaussian integer.
| c | The operand (must not be NULL) |
|
extern |
Create a new copy with reference count 1.
| c | The complex number to copy (must not be NULL) |
|
extern |
Divide two Gaussian integers (returns exact rational result)
| a | Dividend (must not be NULL) |
| b | Divisor (must not be NULL and not zero) |
|
extern |
Test if two Gaussian integers are equal.
| a | First operand (must not be NULL) |
| b | Second operand (must not be NULL) |
|
extern |
Create a Gaussian integer from dynamic integer components.
| real | The real part (must not be NULL) |
| imag | The imaginary part (must not be NULL) |
|
extern |
Create a Gaussian integer from int64_t real and imaginary parts.
| real | The real part |
| imag | The imaginary part |
|
extern |
Get the Gaussian integer i (0 + 1i)
|
extern |
Get the imaginary part of a Gaussian integer.
| c | The complex number (must not be NULL) |
|
extern |
Test if a Gaussian integer is purely imaginary (real part is zero)
| c | The complex number (must not be NULL) |
|
extern |
Test if a Gaussian integer is real (imaginary part is zero)
| c | The complex number (must not be NULL) |
|
extern |
Test if a Gaussian integer is zero.
| c | The complex number (must not be NULL) |
|
extern |
Multiply two Gaussian integers.
| a | First operand (must not be NULL) |
| b | Second operand (must not be NULL) |
|
extern |
Get the Gaussian integer -i (0 - 1i)
|
extern |
Get the Gaussian integer -1 (-1 + 0i)
|
extern |
Negate a Gaussian integer.
| c | The operand (must not be NULL) |
|
extern |
Get the Gaussian integer one (1 + 0i)
|
extern |
Get the real part of a Gaussian integer.
| c | The complex number (must not be NULL) |
|
extern |
Decrement reference count and possibly free memory.
| c | Pointer to complex number pointer (gracefully handles NULL) |
|
extern |
Increment reference count and return the same object.
| c | The complex number to retain (must not be NULL) |
|
extern |
Subtract two Gaussian integers.
| a | First operand (must not be NULL) |
| b | Second operand (must not be NULL) |
|
extern |
Convert Gaussian integer to mathematical string representation.
| c | The complex number (must not be NULL) |
|
extern |
Get the Gaussian integer zero (0 + 0i)