<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I wrote some test programs that use the function i
require, and was wondering if somebody could debug the errors in the follow
lines from two separate test programs.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Program 1. Print the results of the power of
two numbers</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT size=2>
<DIV><FONT face=Arial>mpz_t pow1;</FONT></DIV>
<DIV><FONT face=Arial>mpz_t pow2;</FONT></DIV>
<DIV><FONT face=Arial>mpz_t result;</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>UINT mod=2;</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>mpz_init(pow1);</FONT></DIV>
<DIV><FONT face=Arial>mpz_init(pow2);</FONT></DIV>
<DIV><FONT face=Arial>mpz_init(result);</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>mpz_set_str(pow1,"1000",0);</FONT></DIV>
<DIV><FONT face=Arial>mpz_set_str(pow2,"2",0);</FONT></DIV>
<DIV><FONT face=Arial>mpz_set_str(result,"2",0);</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>mpz_powm( result, pow1 , pow2 , &mo</FONT><FONT
face=Arial>d);</FONT></DIV>
<DIV><FONT face=Arial>mpz_out_str (stdout, 1000, result);</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>mpz_clear( result );</FONT></DIV>
<DIV><FONT face=Arial>mpz_clear( pow1 );</FONT></DIV>
<DIV><FONT face=Arial>mpz_clear( pow2 );</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Program 2. Read and print a file as one number 1000 bytes
at a time</FONT></DIV>
<DIV><FONT face=Arial> INPUT_FILE;<BR> UCHAR line[1000];</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial> mpz_t
result;<BR> mpz_init(result);<BR> FILELOOP;<BR> fread(&line,1000,1,input);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial> mpz_set_str(result,line,0);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial> mpz_out_str(stdout, 1000,
result);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial> END;</FONT></DIV>
<DIV><FONT face=Arial><FONT face=Arial></FONT></FONT> </DIV>
<DIV><FONT face=Arial>mpz_clear( result );</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>.. Thanks to anybody who can point out the error ahead of
time</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>- Image</FONT></DIV></FONT></BODY></HTML>