예제 #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));
 }