Lines Matching refs:BigRat
41 cout << 101 << " = " << BigRat(101,1) << endl; in program()
42 cout << power(101, 9) << " = " << BigRat(power(101,9),1) << endl; in program()
45 BigRat frac(a,b); in program()
46 CoCoA_ASSERT_ALWAYS(frac == BigRat(a,BigInt(b))); in program()
47 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(a),b)); in program()
48 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(a),BigInt(b))); in program()
51 CoCoA_ASSERT_ALWAYS(frac == BigRat(-a,-b)); in program()
52 CoCoA_ASSERT_ALWAYS(frac == BigRat(-a,BigInt(-b))); in program()
53 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(-a),-b)); in program()
54 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(-a),BigInt(-b))); in program()
57 CoCoA_ASSERT_ALWAYS(frac == BigRat(a*b, b*b)); in program()
58 CoCoA_ASSERT_ALWAYS(frac == BigRat(a*b, BigInt(b*b))); in program()
59 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(a*b), b*b)); in program()
60 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(a*b), BigInt(b*b))); in program()
63 CoCoA_ASSERT_ALWAYS(frac == BigRat(-a*b, -b*b)); in program()
64 CoCoA_ASSERT_ALWAYS(frac == BigRat(-a*b, BigInt(-b*b))); in program()
65 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(-a*b), -b*b)); in program()
66 CoCoA_ASSERT_ALWAYS(frac == BigRat(BigInt(-a*b), BigInt(-b*b))); in program()
70 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(-a,b))); in program()
71 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(a,-b))); in program()
72 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(-a,BigInt(b)))); in program()
73 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(a,BigInt(-b)))); in program()
74 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(-a),b))); in program()
75 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(a),-b))); in program()
76 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(-a),BigInt(b)))); in program()
77 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(a),BigInt(-b)))); in program()
80 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(-a*b,b*b))); in program()
81 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(a*b,-b*b))); in program()
82 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(-a*b,BigInt(b*b)))); in program()
83 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(a*b,BigInt(-b*b)))); in program()
84 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(-a*b),b*b))); in program()
85 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(a*b),-b*b))); in program()
86 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(-a*b),BigInt(b*b)))); in program()
87 CoCoA_ASSERT_ALWAYS(IsZero(frac + BigRat(BigInt(a*b),BigInt(-b*b)))); in program()
90 BigRat frac2; in program()
98 CoCoA_ASSERT_ALWAYS(frac2 == BigRat(a*a, b*b)); in program()
118 CoCoA_ASSERT_ALWAYS(frac2 == BigRat(80,-9)); in program()
120 CoCoA_ASSERT_ALWAYS(BigRat(-71,9) == ++frac2); in program()
121 CoCoA_ASSERT_ALWAYS(frac2++ == BigRat(71,-9)); in program()
122 CoCoA_ASSERT_ALWAYS(frac2 == BigRat(62,-9)); in program()
123 CoCoA_ASSERT_ALWAYS(--frac2 == BigRat(-71,9)); in program()
124 CoCoA_ASSERT_ALWAYS(BigRat(71,-9) == frac2--); in program()
125 CoCoA_ASSERT_ALWAYS(frac2 == BigRat(-80,9)); in program()
128 CoCoA_ASSERT_ALWAYS(frac == BigRat(-80,9)); in program()
129 CoCoA_ASSERT_ALWAYS(frac2 == BigRat(a,b)); in program()
138 CoCoA_ASSERT_ALWAYS(frac+frac2 == BigRat(9*a-80*b,9*b)); in program()
139 CoCoA_ASSERT_ALWAYS(frac-frac2 == BigRat(-9*a-80*b,9*b)); in program()
140 CoCoA_ASSERT_ALWAYS(frac*frac2 == BigRat(-80*a,9*b)); in program()
141 CoCoA_ASSERT_ALWAYS(frac/frac2 == BigRat(-80*b,9*a)); in program()
143 CoCoA_ASSERT_ALWAYS(frac+BigInt(10) == BigRat(10,9)); in program()
144 CoCoA_ASSERT_ALWAYS(frac-BigInt(10) == BigRat(-170,9)); in program()
145 CoCoA_ASSERT_ALWAYS(frac*BigInt(10) == BigRat(-800,9)); in program()
146 CoCoA_ASSERT_ALWAYS(frac/BigInt(10) == BigRat(-8,9)); in program()
148 CoCoA_ASSERT_ALWAYS(BigInt(-10)+frac == BigRat(-170,9)); in program()
149 CoCoA_ASSERT_ALWAYS(BigInt(-10)-frac == BigRat(-10,9)); in program()
150 CoCoA_ASSERT_ALWAYS(BigInt(-10)*frac == BigRat(800,9)); in program()
151 CoCoA_ASSERT_ALWAYS(BigInt(-10)/frac == BigRat(9,8)); in program()
153 CoCoA_ASSERT_ALWAYS(frac+10 == BigRat(10,9)); in program()
154 CoCoA_ASSERT_ALWAYS(frac-10 == BigRat(-170,9)); in program()
155 CoCoA_ASSERT_ALWAYS(frac*10 == BigRat(-800,9)); in program()
156 CoCoA_ASSERT_ALWAYS(frac/10 == BigRat(-8,9)); in program()
158 CoCoA_ASSERT_ALWAYS(10+frac == BigRat(10,9)); in program()
159 CoCoA_ASSERT_ALWAYS(10-frac == BigRat(170,9)); in program()
160 CoCoA_ASSERT_ALWAYS(10*frac == BigRat(-800,9)); in program()
161 CoCoA_ASSERT_ALWAYS(10/frac == BigRat(-9,8)); in program()
163 BigRat frac3 = power(frac2, 17); in program()
164 CoCoA_ASSERT_ALWAYS(frac3 == BigRat(power(a,17), power(b,17))); in program()
167 CoCoA_ASSERT_ALWAYS(frac3 == BigRat(power(a,255), power(b,255))); in program()
233 CoCoA_ASSERT_ALWAYS(round(BigRat(1,2)) == RoundDiv(1,2)); in program()
234 CoCoA_ASSERT_ALWAYS(round(BigRat(-1,2)) == RoundDiv(-1,2)); in program()