Exemplo n.º 1
0
        /** Set this ratio to this - r
         */
        public void sub(Rational r)
        {
            n = n * r.getD() - r.getN() * d;
            d = d * r.getD();

            // simplify now to avoid overflow problems
            _simplified = false;
            simplify();
            // Must recalculate the double value.
            _gotDoubleValue = false;
        }
Exemplo n.º 2
0
        /** Set the value of this IntRatio to the given Ratioanal.
         */
        public void set(Rational r)
        {
            n = r.getN();
            d = r.getD();

            // Must recalculate the double value.
            _gotDoubleValue = false;
            // No need to simplify until necessary.
            _simplified = false;
        }
Exemplo n.º 3
0
 /** Creates new IntRatio from the given Rational.
  */
 public IntRatio(Rational r)
 {
     n = r.getN();
     d = r.getD();
 }
Exemplo n.º 4
0
        /** Set this ratio to this - r
         */
        public void sub(Rational r)
        {
            n = n * r.getD() - r.getN() * d;
            d = d * r.getD();

            // simplify now to avoid overflow problems
            _simplified = false;
            simplify();
            // Must recalculate the double value.
            _gotDoubleValue = false;
        }
Exemplo n.º 5
0
        /** Set the value of this IntRatio to the given Ratioanal.
         */
        public void set(Rational r)
        {
            n = r.getN();
            d = r.getD();

            // Must recalculate the double value.
            _gotDoubleValue = false;
            // No need to simplify until necessary.
            _simplified = false;
        }
Exemplo n.º 6
0
 /** Creates new IntRatio from the given Rational.
  */
 public IntRatio(Rational r)
 {
     n = r.getN();
     d = r.getD();
 }