示例#1
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Multiply(mpq x)
        {
            var q = new mpq();

            mpir.mpq_mul(q, this, x);
            return(q);
        }
示例#2
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq MultiplyBy2Exp(uint x)
        {
            var q = new mpq();

            mpir.mpq_mul_2exp(q, this, x);
            return(q);
        }
示例#3
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Subtract(mpq x)
        {
            var q = new mpq();

            mpir.mpq_sub(q, this, x);
            return(q);
        }
示例#4
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Negate()
        {
            var q = new mpq();

            mpir.mpq_neg(q, this);
            return(q);
        }
示例#5
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq DivideFrom(mpq x)
        {
            var q = new mpq();

            mpir.mpq_div(q, x, this);
            return(q);
        }
示例#6
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Divide(mpq x)
        {
            var q = new mpq();

            mpir.mpq_div(q, this, x);
            return(q);
        }
示例#7
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq DivideBy2Exp(uint x)
        {
            var q = new mpq();

            mpir.mpq_div_2exp(q, this, x);
            return(q);
        }
示例#8
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Inverse()
        {
            var q = new mpq();

            mpir.mpq_inv(q, this);
            return(q);
        }
示例#9
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Abs()
        {
            var q = new mpq();

            mpir.mpq_abs(q, this);
            return(q);
        }
示例#10
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Add(mpq x)
        {
            var q = new mpq();

            mpir.mpq_add(q, this, x);
            return(q);
        }
示例#11
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq SubtractFrom(mpq x)
        {
            var q = new mpq();

            mpir.mpq_sub(q, x, this);
            return(q);
        }
示例#12
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Root(uint n, out bool isExact)
        {
            bool isNumExact;
            bool isDenExact;

            var ans = new mpq(Numerator.Root(n, out isNumExact), Denominator.Root(n, out isDenExact));

            isExact = isNumExact && isDenExact;

            return(ans);
        }
示例#13
0
文件: mpq.cs 项目: Samayel/Mpir.NET
        public virtual mpq Sqrt(out bool isExact)
        {
            bool isNumExact;
            bool isDenExact;

            var ans = new mpq(Numerator.Sqrt(out isNumExact), Denominator.Sqrt(out isDenExact));

            isExact = isNumExact && isDenExact;

            return(ans);
        }
示例#14
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public static int Compare(mpq x, double y)
 {
     return(x.CompareTo(y));
 }
示例#15
0
文件: xmpq.cs 项目: Samayel/Mpir.NET
 public override mpq Multiply(mpq x)
 {
     mpir.mpq_mul(this, this, x);
     return(this);
 }
示例#16
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public mpq(mpq op) : this()
 {
     mpir.mpq_set(this, op);
 }
示例#17
0
文件: xmpq.cs 项目: Samayel/Mpir.NET
 public override mpq Divide(mpq x)
 {
     mpir.mpq_div(this, this, x);
     return(this);
 }
示例#18
0
 public bool Equals(mpq other)
 {
     return(!ReferenceEquals(other, null) && Equals(other.ToMpf()));
 }
示例#19
0
 public mpf(mpq op, ulong?precision = null) : this(precision : precision)
 {
     mpir.mpf_set_q(this, op);
 }
示例#20
0
 public int CompareTo(mpq other)
 {
     return(CompareTo(other.ToMpf()));
 }
示例#21
0
文件: xmpq.cs 项目: Samayel/Mpir.NET
 public override mpq SubtractFrom(mpq x)
 {
     mpir.mpq_sub(this, x, this);
     return(this);
 }
示例#22
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public static int Compare(mpq x, uint y)
 {
     return(x.CompareTo(y));
 }
示例#23
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public bool Equals(mpq other)
 {
     return(!ReferenceEquals(other, null) &&
            (ReferenceEquals(this, other) || (mpir.mpq_equal(this, other) != 0)));
 }
示例#24
0
 public override mpfr Add(mpq x, RoundingMode?roundingMode = null)
 {
     mpir.mpfr_add_q(this, this, x, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
     return(this);
 }
示例#25
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public int CompareTo(mpq other)
 {
     return(Math.Sign(mpir.mpq_cmp(this, other)));
 }
示例#26
0
文件: xmpq.cs 项目: Samayel/Mpir.NET
 public xmpq(mpq op) : base(op)
 {
 }
示例#27
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public static int Compare(uint x, mpq y)
 {
     return(-y.CompareTo(x));
 }
示例#28
0
文件: xmpq.cs 项目: Samayel/Mpir.NET
 public override mpq Add(mpq x)
 {
     mpir.mpq_add(this, this, x);
     return(this);
 }
示例#29
0
文件: mpq.cs 项目: Samayel/Mpir.NET
 public static int Compare(double x, mpq y)
 {
     return(-y.CompareTo(x));
 }
示例#30
0
文件: mpc.cs 项目: Samayel/Mpir.NET
 public mpc(mpq op, long?precision = null, RoundingMode?roundingMode = null) : this(precision : precision)
 {
     mpir.mpc_set_q(this, op, (int)roundingMode.GetValueOrDefault(DefaultRoundingMode));
 }