mpfr functions as argument

I want to pass an mpfr functon as argument, in the following way:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void func(int (*fu)(mpfr_t, mpfr_t, mpfr_rnd_t)) {
	
	mpfr_t m1, m2;
	mpfr_inits2(500, m1, m2, (mpfr_ptr)0);
	mpfr_set_str(m1, "15e-1", 10, GMP_RNDN);
	fu(m2, m1, GMP_RNDN);
	mpfr_out_str(stdout, 10, 10, m2, GMP_RNDN);
	cout << endl;
	mpfr_clears(m1, m2, (mpfr_ptr)0);
}

int main() {

	func(&mpfr_j0);
	
	return 0;
}


But I get this error from line 14: invalid conversion from 'int (*) (__mpfr_struct*, const __mpfr_struct*, mpfr_rnd_t)' to 'int (*) (__mpfr_struct*, __mpfr_struct*, mpfr_rnd_t)'

However in the mpfr tutorial it says that mpfr_j0 should be:
int mpfr_j0(mpfr_t, mpfr_t, mpfr_rnd_t)
with no mention of const. Anyone knows whats going on?
You should ask this in the MPFR mailing list.
Oh ok, sorry
Topic archived. No new replies allowed.