Ejemplo n.º 1
0
        public virtual mpc Power(mpfr exponent, RoundingMode?roundingMode = null)
        {
            var c = new mpc(precisionRe: PrecisionRe, precisionIm: PrecisionIm);

            mpir.mpc_pow_fr(c, this, exponent, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
            return(c);
        }
Ejemplo n.º 2
0
        public mpfr Norm(mpfr.RoundingMode?roundingMode = null)
        {
            var fr = new mpfr(precision: Math.Max(PrecisionRe, PrecisionIm));

            mpir.mpc_norm(fr, this, (int)roundingMode.GetValueOrDefault(mpfr.DefaultRoundingMode));
            return(fr);
        }
Ejemplo n.º 3
0
        public virtual mpc DivideFrom(mpfr x, RoundingMode?roundingMode = null)
        {
            var c = new mpc(precisionRe: Math.Max(PrecisionRe, x.Precision), precisionIm: Math.Max(PrecisionIm, x.Precision));

            mpir.mpc_fr_div(c, x, this, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
            return(c);
        }
Ejemplo n.º 4
0
        public virtual mpc Multiply(mpfr x, RoundingMode?roundingMode = null)
        {
            var c = new mpc(precisionRe: Math.Max(PrecisionRe, x.Precision), precisionIm: Math.Max(PrecisionIm, x.Precision));

            mpir.mpc_mul_fr(c, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
            return(c);
        }
Ejemplo n.º 5
0
 public override mpfr Remainder(mpfr y, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_remainder(this, this, y, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 6
0
 public override mpfr Fms(mpfr x, mpfr y, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_fms(this, this, x, y, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 7
0
 public override mpfr PositiveDifference(mpfr x, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_dim(this, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 8
0
 public override mpfr Power(mpfr exponent, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_pow(this, this, exponent, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 9
0
 public override mpfr DivideFrom(mpfr x, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_div(this, x, this, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 10
0
 public mpc(mpfr re, mpfr im, long?precisionRe = null, long?precisionIm = null, RoundingMode?roundingMode = null) : this(precisionRe : precisionRe, precisionIm : precisionIm)
 {
     mpir.mpc_set_fr_fr(this, re, im, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
 }
Ejemplo n.º 11
0
 public override mpfr CopySignBit(mpfr sign, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_copysign(this, this, sign, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 12
0
 public mpc(mpfr op, long?precision = null, RoundingMode?roundingMode = null) : this(precision : precision)
 {
     mpir.mpc_set_fr(this, op, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
 }
Ejemplo n.º 13
0
 public static int Compare(mpfr x, mpfr y)
 {
     return(x.CompareTo(y));
 }
Ejemplo n.º 14
0
 public override mpfr RemainderQuotient(mpfr y, out int q, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_remquo(this, out q, this, y, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 15
0
 internal xmpfr(mpfr op) : base(precision: op.Precision)
 {
     mpir.mpfr_set(this, op, (int)DefaultRoundingMode);
 }
Ejemplo n.º 16
0
 public override mpfr NextToward(mpfr y)
 {
     mpir.mpfr_nexttoward(this, y);
     return(this);
 }
Ejemplo n.º 17
0
 public override mpfr Multiply(mpfr x, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_mul(this, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 18
0
 public override mpfr Subtract(mpfr x, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_sub(this, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
Ejemplo n.º 19
0
 public override mpc Add(mpfr x, RoundingMode?roundingMode = null)
 {
     mpir.mpc_add_fr(this, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }