Segfault when calling mpf_get_str
Navid Roux
n.roux at outlook.com
Thu Sep 20 20:34:20 CEST 2012
Hello all,
I get a segmentation fault in my program when I call mpf_get_str().
I've found this mail in your archives:
http://gmplib.org/list-archives/gmp-discuss/2003-November/000888.html
So the error most likely comes from my code. It would be very unlikely that
GMP has a bug in a major function.
My system:
-------------------------------
OS:
- Windows 8 RTM 64-bit
Compiler:
- MinGW with GCC 4.6.2
Libraries/frameworks:
- wxWidgets 2.9.4 (I only use wxWidgets for UI and threads)
- GMP 5.05
All components were built using the stated compiler.
I thought you do not want the code to be here in the mail, so I've uploaded
it to pastebin.com:
http://pastebin.com/JSKXVQu4 - please don't worry - it is not too long, the
calculation section is just 12 LOC long.
The program calculates PI with this formula:
u_2n = 2 * n * sqrt( 0.5 - 0.5 * sqrt(1 - (u_n/n)²) );
or better using LaTex (copy the full URL!):
http://latex.codecogs.com/png.latex?\LARGE u_{2n} = 2 \cdot n \cdot
\sqrt{0.5 - 0.5 \cdot \sqrt{1 - (\frac{u_n}{n})^2}}
Many thanks in advance!!
Best Regards
ComFreek
More information about the gmp-discuss
mailing list