⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.c

📁 calc大数库
💻 C
📖 第 1 页 / 共 4 页
字号:
	  printf("***************************************\n");
	  GetReturn();
	}
	else if(strcmp(name, sqroot_str) == 0) {
	  printf("\n***************************************\n");
	  printf("Usage: z=sqroot(a,n,&s[],&m,&l)\n");
	  printf("Returns the solutions of x^2=a (mod n)\n");
	  printf("as x=s[i] or -s[i] (mod m), 0 <= s[i] <= m/2.\n");
	  printf("z is the number of solutions mod n.\n");
	  printf("If there is no solution, z=0 is returned\n");
	  printf("together with s[0]=NULL and m=NULL.\n");
	  printf("l is the number of solutions s[i] returned.\n");
	  printf("***************************************\n");
	  GetReturn();
	}
	else if(strcmp(name, cornacchia_str) == 0) {
	  printf("\n***************************************\n");
	  printf("Usage: z=cornacchia(a,b,m)\n");
	  printf("Returns the positive primitive solutions (x,y) of a*x^2+b*y^2=m, where if a=b=1, x>=y.\n");
	  printf("Here a>0,b>0,m>a+b, gcd(a,b)=1=gcd(a,m).\n");
	  printf("***************************************\n");
	  GetReturn();
	}
	else if(strcmp(name, patz_str) == 0) {
	  printf("\n***************************************\n");
	  printf("Usage: patz(d,n)\n");
	  printf("Returns the positive, primitive fundamental solutions (x,y) of x^2-d*y^2=n and -n,\n");
	  printf("in the case of solubility, where d>0 and not a perfect square.\n");
	  printf("Also output is sent to patz.out.\n");
	  printf("***************************************\n");
	  GetReturn();
	}
	else if(strcmp(name, congq_str) == 0) {
	  printf("\n***************************************\n");
	  printf("Usage: z=congq(a,b,c,n,&s[])\n");
	  printf("Solves the congruence ax^2+bx+c=0(mod n), a nonzero, n>0.\n");
	  printf("z= number of solutions mod n.\n");
	  printf("***************************************\n");
	  GetReturn();
	}
	else if(strcmp(name, binform_str) == 0) {
	  printf("\n***************************************\n");
	  printf("Usage: binform(a,b,c,n,e)\n");
	  printf("Solves the diophantine equation ax^2+bxy+cy^2=n, n non-zero,\n");
	  printf("where D=b^2-4ac>0 and is not a perfect square.\n");
	  printf("One solution from each class is printed,\n");
	  printf("together with the corresponding solution n\n");
	  printf("of the congruence n^2=D (mod 4|N|), -|N|<n<=|N|.\n");
	  printf("e=1 is verbose, e=0 is terse\n");
	  printf("***************************************\n");
	  GetReturn();
	}
	else if (strcmp(name, ceil_str) == 0)
	{
		printf("          **************************\n");
		printf("ceil: usage: ceil(a,b)\n");
		printf("Returns the least integer not less than a/b\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, resultant_str) == 0)
	{
		printf("          **************************\n");
		printf("resultant: usage: r=resultant(p,q)\n");
		printf("Returns the resultant of non-constant polynomials p and q\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, discriminant_str) == 0)
	{
		printf("          **************************\n");
		printf("discriminant: usage: r=discriminant(p)\n");
		printf("Returns the discriminant of polynomial p\n");
		printf("not of the from aX+b\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, deriv_str) == 0)
	{
		printf("          **************************\n");
		printf("deriv: usage: q=deriv(p)\n");
		printf("Returns the derivative of polynomial p\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, primes_str) == 0)
	{
		printf("          **************************\n");
		printf("primes: usage: c=primes(m,n)\n");
		printf("where 1<=m<10^10, 1<=n<10^10, \n");
		printf("prints the primes if any, in the interval [m,n]\n");
		printf("and returns their number\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, sturmsequence_str) == 0)
	{
		printf("          **************************\n");
		printf("primes: usage: c=sturmdequence(f,b,e)\n");
		printf("where f is a polynomial, squarefree, deg(f)>1\n");
		printf("Also f(b) is non-zero.\n");
		printf("The Sturm polynomials are listed, along with\n");
		printf("their values at x=b. c is the no. of sign-changes.\n");
		printf("e=0 suppresses printing.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, cyclotomic_str) == 0)
	{
		printf("          **************************\n");
		printf("cyclotomic: usage: p=cyclotomic(n)\n");
		printf("where 1 <= n < 65536\n");
		printf("Returns the nth cyclotomic polynomial\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, classnop_str) == 0)
	{
		printf("          **************************\n");
		printf("classnop: usage: h=classnop(d)\n");
		printf("where 1 < d < 10^6 is squarefree.\n");
		printf("Returns the class-number of the real quadratic field\n");
		printf("Q(sqrt(d) and the sign of the fundamental unit.\n");
		printf("A complete set of reduced binary forms is given\n");
		printf("corresponding to the classes of ideals.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, classnon_str) == 0)
	{
		printf("          **************************\n");
		printf("classnon: usage: h=classnon(d,e)\n");
		printf("where d < 0 and 1 < |d| < 10^6 is squarefree\n");
 		printf("and d=0 or 1(mod 4).\n");
                printf("    This is Henri Cohen's Algorithm 5.3.5, p. 228,\n");
                printf("for finding the class number h(d) of binary quadratic forms\n");
                printf("of discriminant d, when d<0.\n");
		printf("If e=1, we print only the primitive forms.\n");
 		printf("h(d) is returned in each case.\n\n");
 		printf("If d is the discriminant of an imaginary quadratic field K,\n");
 		printf("then the primitive forms class-number h(d) is also\n");
		printf("the class number of K.\n\n");
 		printf("    Davenport's Higher Arithmetic has a table of forms,\n");		printf("which lists the imprimitive ones with an asterisk.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, nearint_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: z=nearint(a,b), b > 0;\n");
		printf("z the nearest integer t to a/b,\n");
		printf("where z = t if a/b = 1/2 + t, t an integer.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, reduceneg_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: n=reduceneg(a,b,c)), a > 0, c > 0 and b^2-4ac < 0.\n");
		printf("This is Gauss's algorithm for reducing a positive\n");
		printf("definite binary quadratic form. See L.E. Dickson, \n");
		printf("Introduction to the theory of numbers, page 69. \n");
		printf("The reduced form (A,B,C) satisfies -A<B<=A, C>=A, \n");
		printf("with B>=0 if C=A.\n");
 		printf("The number of steps taken in the reduction is returned.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, reducepos_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: n=reducepos(a,b,c), d=b^2-4ac > 0, d not a square.\n");
		printf("We also assume that d < 10^6.\n");
		printf("We use the PQa continued fraction algorithm to find\n");
	        printf("an equivalent reduced form and thence a cycle of reduced forms.\n");
	        printf("A unimodular tranforming matrix transforming (a,b,c) to a reduced form is constructed.\n");
	        printf("The cycle-length is returned. A file reducepos.out is also created.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, classnop0_str) == 0)
	{
		printf("          **************************\n");
		printf("classnop0: usage: h=classnop0(d)\n");
		printf("where 1 < d < 10^6 is not a perfect square.\n");
		printf("d = 0 or 1 (mod 4).\n");
		printf("h is the number of classes of binary quadratic forms of discriminant d\n");
		printf("A complete set of reduced binary forms is given.\n");
		printf("We determine if the Pell equation x^2-d*y^2=-4 has\n");
                printf("has a solution, by using the fact that the equation\n");
                printf("is soluble iff at least one of the above cycles is odd.\n"); 
		printf("If there is no solution, the reduced forms (-a,b,-c)\n");
		printf("have to be counted as well. \n");
		printf("(See G.B. Mathews, Theory of Numbers, 80-81.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, tableneg_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: h=tableneg(m,n),1<=m<=n<10^6.\n");
		printf("Calculates h(-d) for all squarefree d with m<=d<=n.\n");
	        printf("The number of squarefree d  in the range is returned.\n");
	        printf("The output is also sent to tableneg.out.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, tablepos_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: h=tablepos(m,n),2<=m<=n<10^6.\n");
		printf("Calculates h(d) for all squarefree d with m<=d<=n.\n");
	        printf("The number of squarefree d  in the range is returned.\n");
	        printf("The output is also sent to tablepos.out.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, davison_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: h=davison(l,m,n),l,m>=1, 10^5>=n>=0\n");
		printf("h partial quotients a[i] of e^{l/m} are found.\n");
		printf("We cannot predict the value of h.\n");
	        printf("The a[i] are also sent to davison.out.\n");
	        printf("The program stops if 10^6 partial quotients a[i] are found.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, raney_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: t=raney(p,q,r,s),p,q,r,s>=0, p*s-q*r nonzero.\n");
		printf("Let A=[p,q;r,s]. Then we assume A!=I_2, A!=[0,1;1,0].\n");
		printf("With L=[1,0;1,1] and R=[1,1;0,1], we express A uniquely as\n");
		printf("a product of non-negative powers of L and R, (at least one is positive).\n");
		printf("followed by a row-balanced B.\n");
		printf("B=[a,b;c,d] is row-balanced if (a<c & b>d) or (c<a & d>b) and a,b,c>=0.\n");
		printf("The number k of powers of L and R is returned.\n");
		printf("The output is also sent to raney.out.\n");
		printf("See G.N. Raney, Math, Annalen 206 (1973) 265-283.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, unimodular_str) == 0)
	{
	   printf("Usage: t=unimodular(p,q,r,s),p,q,r,s>=0, p*s-q*r = 1 or -1.\n");
           printf("This algorithm expresses a unimodular matrix \n");
	   printf("A !=I_2 or U=[0,1;1,0] with non-negative coefficients\n"); 
	   printf("as a product of one of the following forms:\n"); printf("P, UP, PU, or UPU, where P is a product of matrices\n");
	   printf("of the form U[a]=[a,1;1,0], a > 0.\n");
           printf("The representation is unique. \n");
	   printf("See Kjell Kolden, 'Continued fractions and linear substitutions'\n");
	   printf("Arch. Math. Naturvid. 50 (1949), 141-196.\n");
           printf("The number t of matrices in the product is returned.\n");
           printf("          **************************\n");
	   GetReturn();
	}
	else if (strcmp(name, twoadicsqrt_str) == 0)
	{
	   printf("Usage: twoadicsqrt(b,n), b>0, b=8k+1, n > 0.\n");
	   printf("Finds n terms a[0]...a[n-1] of the 2-adic square root x of a, x=1 (mod 4).\n");	
	   printf("Output also sent to 2-adic.out.\n");	
           printf("          **************************\n");
	   GetReturn();
	}
	else if (strcmp(name, padicsqrt_str) == 0)
	{
	   printf("Usage: padicsqrt(b,p,n.&a[]), b>0, b a quadratic residue (mod p), n > 0.\n");
	   printf("Finds a square root u of b (mod p), 0 < u < p.\n");	
	   printf("Then finds n terms a[0]...a[n-1] of the p-adic square root x of b, x=u (mod p).\n");	
	   printf("Output also sent to p-adic.out.\n");	
           printf("          **************************\n");
	   GetReturn();
	}
	else if (strcmp(name, sigmak_str) == 0)
	{
	   printf("Usage: u=sigmak(k,n), 2^16>k>0, n > 0.\n");
	   printf("Returns the sum of the kth powers of the divisors of n.\n");	
           printf("          **************************\n");
	   GetReturn();
	}
	else if (strcmp(name, ramanujan_str) == 0)
	{
	   printf("Usage: u=ramanujan(n), 2^16>n>0.\n");
	   printf("Returns Ramanujan's tau function.\n");	
           printf("          **************************\n");
	   GetReturn();
	}
	else if (strcmp(name, repdefinite_str) == 0)
	{
		printf("          **************************\n");
		printf("Usage: repdefinite(a,b,c,m,print_flag), a > 0, c > 0 and b^2-4ac < 0.\n");
		printf("This algorithm of Gauss solves the diophantine equation\n");
		printf("ax^2+bxy+cy^2=m, where d=b^2-4ac<0, a>0, c>0, m>0.\n");
		printf("See  L.E. Dickson, Introduction to the Theory of Numbers, 74-75 \n");
		printf("output is sent to repdefinite.out\n");
		printf("print_flag=0 lists only the solutions,\n");
		printf("print_flag=1 lists unimodular transformations\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, powerd_str) == 0)
	{
		printf("          **************************\n");
		printf("powerd: usage: powerd(a,b,d,n,&aa,&bb)\n");
		printf("(a+b*sqrt(d))^n=aa+bb*sqrt(d) is returned.\n");
		printf("a,b,c integers, d>0,n>=0.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else if (strcmp(name, euclid1_str) == 0)
	{
		printf("          **************************\n");
		printf("euclid1: usage: z=euclid1(a,b)\n");
		printf("z is the length of Euclid's algorithm for a /b.\n");
		printf("a and b are positive integers.\n");
		printf("          **************************\n");
		GetReturn();
	}
	else{
		continue;
	}
}
	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -