i have the following

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double power( double, int );
int main()
{
//declare variables
double iSum = 0, iTotalNum = 0, iMod = 10, iTmp = 0;
int iPower = 10;
/* on the basis that 2^15 == (2^3)^5 ie 3 * 5 = 15 */
//calculate 2^10
iTotalNum = power( 2 , iPower );
//calculate (2^10)^10 ie 2^100
iTotalNum = power( iTotalNum, iPower );
//calculate ((2^10)^10)^10 ie 2^1000
iTotalNum = power( iTotalNum, iPower );
iTmp = fmod( 10, 3);
printf("%lf\n\n\n\n%e\n", iTmp, iTotalNum);
return 0;
}
double power( double iBase, int iExponent )
{
//break out clause
if ( iExponent == 1 )
{
//end of line so return 1
return iBase;
}
return iBase * power( iBase, --iExponent );
}

when i try and build/compile it i get |29|undefined reference to `fmod'|

||error: ld returned 1 exit status|

||=== Build failed: 2 error(s), 2 warning(s) (0 minute(s), 0 second(s)) ===|

this happens with pow and sqrt but with them if i write in the numbers manualy rather than using assigned variables they work ie

Code:

pow( x, y) //this fails
pow( 4, 2 )//this works