Jump to content

Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions

m
Reformatted the output.
m (Minor correction.)
m (Reformatted the output.)
Line 6,761:
public final class ContinuedFractionArithmeticG2 {
 
public static void main(String[] aArgs) {
test("[13;5,2 7] -+ [30;7 2]", new NG( new NG8(0, 1, -1, 0, 0, 0, 0, 1), new R2cf(131, 112), new R2cf(22, 7) ),
new NG( new NG4(2, 1, 0, 2), new R2cf(22, 7) ));
test("[31;7 5, 2] +* [03;2 7]", new NG( new NG8(01, 10, 10, 0, 0, 0, 0, 1), new R2cf(113, 211), new R2cf(22, 7) ),
new NG( new NG4(2, 1, 0, 2), new R2cf(22286, 777) ));
test("[1; 5, 2] *- [3; 7]", new NG( new NG8(10, 01, 0-1, 0, 0, 0, 0, 1), new R2cf(13, 11), new R2cf(22, 7) ),
new R2cf(286-151, 77) );
test("Divide [] by [3; 7]",
test("[1;5,2] - [3;7]", new NG( new NG8(0, 1, -1, 0, 0, 0, 0, 1), new R2cf(13, 11), new R2cf(22, 7) ),
new R2cf(-151, 77) );
test("Divide [] by [3;7]",
new NG( new NG8(0, 1, 0, 0, 0, 0, 1, 0), new R2cf(22 * 22, 7 * 7), new R2cf(22,7)) );
test("([0; 3, 2] + [1; 5, 2]) * ([0; 3, 2] - [1; 5, 2])",
new NG( new NG8(1, 0, 0, 0, 0, 0, 0, 1),
new NG( new NG8(0, 1, 1, 0, 0, 0, 0, 1),
Line 6,993 ⟶ 6,992:
{{ out }}
<pre>
Testing: [3; 7] + [0; 2]
3 1 1 1 4
3 1 1 1 4
 
Testing: [1; 5, 2] * [3; 7]
3 1 2 2
3 1 2 2
 
Testing: [1; 5, 2] - [3; 7]
-1 -1 -24 -1 -2
-1 -1 -24 -1 -2
 
Testing: Divide [] by [3; 7]
3 7
 
Testing: ([0; 3, 2] + [1; 5, 2]) * ([0; 3, 2] - [1; 5, 2])
-1 -3 -5 -1 -2 -1 -26 -3
-1 -3 -5 -1 -2 -1 -26 -3
915

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.