Pell's equation: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: used a better form of over/under statement placement.)
Line 120: Line 120:
void test(int n) {
void test(int n) {
struct Pair r = solvePell(n);
struct Pair r = solvePell(n);
printf("x^2 - %3d * y^2 = 1 for x = %21llu nd y = %21llu\n", n, r.v1, r.v2);
printf("x^2 - %3d * y^2 = 1 for x = %21llu and y = %21llu\n", n, r.v1, r.v2);
}
}


Line 132: Line 132:
}</lang>
}</lang>
{{out}}
{{out}}
<pre>x^2 - 61 * y^2 = 1 for x = 1766319049 nd y = 226153980
<pre>x^2 - 61 * y^2 = 1 for x = 1766319049 and y = 226153980
x^2 - 109 * y^2 = 1 for x = 158070671986249 nd y = 15140424455100
x^2 - 109 * y^2 = 1 for x = 158070671986249 and y = 15140424455100
x^2 - 181 * y^2 = 1 for x = 2469645423824185801 nd y = 183567298683461940
x^2 - 181 * y^2 = 1 for x = 2469645423824185801 and y = 183567298683461940
x^2 - 277 * y^2 = 1 for x = 11576121209304062921 nd y = 9562401173878027020</pre>
x^2 - 277 * y^2 = 1 for x = 11576121209304062921 and y = 9562401173878027020</pre>


=={{header|C++}}==
=={{header|C++}}==