Is there a high precision library for C that handles irrational numbers?

I just compiled the MPIR library for visual studio and I found that it does not have trigonometric functions or root functions for floating point numbers.

I need this because I need to do some calculations with transcendental ones that are more than 1000 digits precision.

If anyone can suggest a library that is capable of this and preferably works well with visual studio 2010, I would be very grateful.

+3


source to share


3 answers


Take a look at the relevant links on the GNU MPFR home page .

Specifically, MAPM can do what you want:

MAPM: Portable Arbitrary Precision Math Library in C

...

This library will perform the following functions to any desired level of precision: SQRT, CBRT, SIN, COS, TAN, ARC-SIN, ARC-COS, ARC-TAN, ARC-TAN2, LOG, LOG10, EXP, POW, SINH, COSH, TANH, ARC-SINH, ARC-COSH, ARC-TANH, FLOOR, CEIL, GCD, LCM and also FACTORIAL.



It looks like it should work with Visual Studio:

It is tested under Linux (x86), FreeBSD, HP-UX, Sun Solaris, Venix, MAC OSX, DOS and Win 2000, NT, XP

... with the following compilers ...

o) Microsoft Visual C ++ 6.0 (32-bit) and Microsoft C 5.1, 8.00c (16-bit)

+2


source


Have a look at the GNU Multipoint Arithmetic Library .

GMP is a free library for arbitrary precision arithmetic that works for signed integers, rational numbers, and floating point numbers. There is no practical limit to the accuracy other than those implied by the available memory in a GMP machine running. GMP has a rich feature set, and the features have a regular interface. (..)



And you can find C # /. NET Wrapper here .

+2


source


Have a look at the MPFR library. It can use MPIR and provides much more complete floating point support. Home page http://www.mpfr.org/ . A Visual Studio solution for it can be found at http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php . I had to do a couple of tweaks, but I was able to successfully create MPFR with MPIR.

0


source







All Articles