return type while using GMP.h header file

Posted by Raveesh_Kumar on Stack Overflow See other posts from Stack Overflow or by Raveesh_Kumar
Published on 2010-06-06T19:23:51Z Indexed on 2010/06/06 19:32 UTC
Read the original article Hit count: 128

Filed under:
|

While i m using gmp.h header file. i need a fuction which takes inputs of type mpz_t and return mpz_t type too. I m very beginner of using gmp.h So, Here is snaps follows of my approached code....
mpz_t sum_upto(mpz_t max)
{
mpz_t sum;
mpz_init(sum);
mpz_init(result);
for(int i=0;i<=max-1;i++)
mpz_add_ui(sum,sum,pow(2,i));
return sum;
} but it will show error
1 ." pow has been not used in this scope.",although i have added math.h in very beginnig of the file.
2 . sum_upto declared as function returning an array...

do tell as soon as possible. i have to complete my very big project....

© Stack Overflow or respective owner

Related posts about c++

Related posts about gmp