mirror of
https://github.com/vale981/arb
synced 2025-03-06 01:41:39 -05:00
Merge pull request #45 from rickyefarr/set_functions
Add various set functions
This commit is contained in:
commit
606e8b5bbf
4 changed files with 56 additions and 0 deletions
35
acb.h
35
acb.h
|
@ -225,6 +225,13 @@ acb_set_ui(acb_t z, ulong c)
|
|||
arb_zero(acb_imagref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_d(acb_t z, double c)
|
||||
{
|
||||
arb_set_d(acb_realref(z), c);
|
||||
arb_zero(acb_imagref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_si(acb_t z, long c)
|
||||
{
|
||||
|
@ -232,6 +239,20 @@ acb_set_si(acb_t z, long c)
|
|||
arb_zero(acb_imagref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_si_si(acb_t z, long x, long y)
|
||||
{
|
||||
arb_set_si(arb_realref(z), x);
|
||||
arb_set_si(arb_imagref(z), y);
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_d_d(acb_t z, double x, double y)
|
||||
{
|
||||
arb_set_d(acb_realref(z), x);
|
||||
arb_set_d(acb_imagref(z), y);
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_fmpz(acb_t z, const fmpz_t c)
|
||||
{
|
||||
|
@ -239,6 +260,13 @@ acb_set_fmpz(acb_t z, const fmpz_t c)
|
|||
arb_zero(acb_imagref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_fmpz_fmpz(acb_t z, const fmpz_t x, const fmpz_t y)
|
||||
{
|
||||
arb_set_fmpz(acb_realref(z), x);
|
||||
arb_set_fmpz(acb_imagref(z), y);
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_round_fmpz(acb_t z, const fmpz_t y, long prec)
|
||||
{
|
||||
|
@ -262,6 +290,13 @@ acb_set_arb(acb_t z, const arb_t c)
|
|||
arb_zero(acb_imagref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_arb_arb(acb_t z, const arb_t x, const arb_t y)
|
||||
{
|
||||
arb_set(acb_realref(z), x);
|
||||
arb_set(acb_imagref(z), y);
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_set_round_arb(acb_t z, const arb_t x, long prec)
|
||||
{
|
||||
|
|
7
arb.h
7
arb.h
|
@ -228,6 +228,13 @@ arb_set_ui(arb_t x, ulong y)
|
|||
mag_zero(arb_radref(x));
|
||||
}
|
||||
|
||||
ARB_INLINE void
|
||||
arb_set_d(arb_t x, double y)
|
||||
{
|
||||
arf_set_d(arb_midref(x), y);
|
||||
mag_zero(arb_radref(x));
|
||||
}
|
||||
|
||||
ARB_INLINE void
|
||||
arb_set_fmpz(arb_t x, const fmpz_t y)
|
||||
{
|
||||
|
|
|
@ -108,12 +108,24 @@ Basic manipulation
|
|||
|
||||
.. function:: void acb_set_si(acb_t z, long x)
|
||||
|
||||
.. function:: void acb_set_d(acb_t z, double x)
|
||||
|
||||
.. function:: void acb_set_fmpz(acb_t z, const fmpz_t x)
|
||||
|
||||
.. function:: void acb_set_arb(acb_t z, const arb_t c)
|
||||
|
||||
Sets *z* to the value of *x*.
|
||||
|
||||
.. function:: void acb_set_si_si(acb_t z, long x, long y)
|
||||
|
||||
.. function:: void acb_set_d_d(acb_t z, double x, double y)
|
||||
|
||||
.. function:: void acb_set_fmpz_fmpz(acb_t z, const fmpz_t x, const fmpz_t y)
|
||||
|
||||
.. function:: void acb_set_arb_arb(acb_t z, const arb_t x, const arb_t y)
|
||||
|
||||
Sets the real and imaginary part of *z* to the values *x* and *y* respectively
|
||||
|
||||
.. function:: void acb_set_fmpq(acb_t z, const fmpq_t x, long prec)
|
||||
|
||||
.. function:: void acb_set_round(acb_t z, const acb_t x, long prec)
|
||||
|
|
|
@ -129,6 +129,8 @@ Assignment and rounding
|
|||
|
||||
.. function:: void arb_set_ui(arb_t y, ulong x)
|
||||
|
||||
.. function:: void arb_set_d(arb_t y, double x)
|
||||
|
||||
.. function:: void arb_set_fmpz(arb_t y, const fmpz_t x)
|
||||
|
||||
Sets *y* to the value of *x* without rounding.
|
||||
|
|
Loading…
Add table
Reference in a new issue