--- projs/dtats/trunk/projs/2018/20180707_cgi_web_tools_aux_exe/dtats_cgi_aux_arith_large/subfunc_gmp_prob_prime.c 2018/07/15 19:48:41 206 +++ projs/dtats/trunk/projs/2018/20180707_cgi_web_tools_aux_exe/dtats_cgi_aux_arith_large/subfunc_gmp_prob_prime.c 2018/07/15 21:50:56 207 @@ -40,7 +40,7 @@ //INPUT PARAMETERS //---------------- //The subfunction accepts two parameters, the integers whose primality is to be -//assessed, and the number of reps (passed directly to the GMP function). +//assessed, and the number of reps (passed directly to the GMP function). //Naturally, the integers should be positive. Invalid integers are assigned //defaults. It is the responsibility of the calling script to do whatever //sanity checking is desired. @@ -69,7 +69,7 @@ //and the first and last line will be "S". // //The return value (exit code) from this subfunction is always 0. -// +// #define MODULE_SUBFUNC_GMP_PROB_PRIME @@ -108,7 +108,7 @@ return(0); } - //Copy the command-line arguments to a safe place where we can manipulate them. + //Copy the command-line arguments to a safe place where we can manipulate them. //Leave 2 characters of space in case we assign a "0". arg1 = (char *)malloc((AUXFUNCS_size_t_max(1, strlen(argv[2])) + 1) * sizeof(char)); arg2 = (char *)malloc((AUXFUNCS_size_t_max(1, strlen(argv[3])) + 1) * sizeof(char)); @@ -158,7 +158,7 @@ mpz_set_str(number_to_test, arg1, 10); mpz_set_str(nreps_mpz, arg2, 10); - //We don't want to allow any more than 5000 repetitions for that + //We don't want to allow any more than 5000 repetitions for that //parameter. So, if it is larger than 5000, whack it down. if (mpz_cmp_d(nreps_mpz, (double)5000) > 0) mpz_set_str(nreps_mpz, "5000", 10); @@ -167,22 +167,22 @@ //a normal integer. nreps_native = mpz_get_si(nreps_mpz); - //Run the GMP library function to guess at primality and get the result + //Run the GMP library function to guess at primality and get the result //back. gmp_result = mpz_probab_prime_p(number_to_test, nreps_native); //Now, write the output block. printf("S\n"); - mpz_out_str(stdout, 10, number_to_test); - printf("\n"); - mpz_out_str(stdout, 10, nreps_mpz); + mpz_out_str(stdout, 10, number_to_test); + printf("\n"); + mpz_out_str(stdout, 10, nreps_mpz); printf("\n"); printf("%d\n", gmp_result); printf("S\n"); //Always return 0. return(0); - } + } //******************************************************************************** // End of SUBFUNC_GMP_PROB_PRIME.C.