Questions tagged [mpfr]

The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.

The MPFR library is built on the GNU Multi-Precision Arithmetic Library. It is licensed under the GNU LGPL v3 (or later versions).

The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.

The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 standard for double-precision floating-point arithmetic (53-bit significand).

Both GMP and MPFR (and also MPC) are prerequisites when building the GNU Compiler Collection.

198 questions
4
votes
1 answer

gmp-mpfr-sys fails to build on macOS catalina 10.15.6

I am on macOS catalina 10.15.6. I am trying to use the rug crate in rust, particularly, the float library that uses MPFR. I am unable to compile the code due to a segmentation fault. The exact error and a small example program are below. Does anyone…
Chandra
  • 121
  • 1
  • 10
4
votes
4 answers

Getting MPFR to build on cygwin

I spent the whole day setting up GCC as per http://cygwin.wikia.com/wiki/How_to_install_GCC_4.3.0 On the gcc make step, it told me it needed a c++ compiler to continue for whatever reason, So I updated Cygwin in the usual fashion and got…
RGroppa
  • 325
  • 2
  • 13
4
votes
2 answers

Installation of package ‘Rmpfr’ had non-zero exit status in R

I am unable to install the Rmpfr package in R. I am trying to use the CVXR package in order to solve OR problems. Since Rmpfr package is needed as a pre-requisite, I tried installing the same using install.packages('Rmpfr'). The error I am getting…
karunyav
  • 41
  • 1
  • 2
4
votes
1 answer

MPFR: get sin of mpf_class

I installed gmp and mpfr on my environment. Now I can successfully #include #include #include Now, say that I initialize an mpf_class with some value: mpf_class x = 0.73; How can I use mpfr to get the sin of this…
Matteo Monti
  • 8,362
  • 19
  • 68
  • 114
4
votes
1 answer

There is a real reason for gcc to be so conservative with its dependecies ? ( MPFR, GMP, MPC )

I'm wondering if someone knows why gcc tends to be so conservative about the versions of the libraries to use to compile and build gcc itself . The main reasons why I'm asking this are : I think that there is a big shift between the "implicitly…
user2485710
  • 9,451
  • 13
  • 58
  • 102
4
votes
1 answer

How to use complex numbers with boost::multiprecision::mpfr?

According to https://stackoverflow.com/a/17932632/1700939, it should be possible to use complex numbers with boost::multiprecision with gcc-4.7. This indeed works fine with boost::multiprecision::float128: -----------test.cpp------------ #include…
Sunday
  • 631
  • 1
  • 7
  • 14
4
votes
3 answers

How to install MPFR and GMP for C++ on visual studio

As I understand, I should first install GMP. The only tutorial I found for this purpose is http://cs.nyu.edu/exact/core/gmp/ and when I reach step 3: "Open gmp.dsw (gmp.vcproj for VC++.Net) to build GMP" I get many building errors. You can download…
Ella Sharakanski
  • 2,683
  • 3
  • 27
  • 47
4
votes
2 answers

python 'bigfloat' package installation issues

I'm trying to get the package 'bigfloat' installed on my Mac (OS X 10.8.4), and I'm running into some issues. The package 'bigfloat' requires two other dependencies: 1) mpfr, and 2) gmp. I've installed gmp here: http://gmplib.org/ <-- This seemed…
astromax
  • 6,001
  • 10
  • 36
  • 47
4
votes
3 answers

Haskell FFI / C MPFR library wrapper woes

In order to create an arbitrary precision floating point / drop in replacement for Double, I'm trying to wrap MPFR using the FFI but despite all my efforts the simplest bit of code doesn't work. It compiles, it runs, but it crashes mockingly after…
Jared Updike
  • 7,165
  • 8
  • 46
  • 72
4
votes
1 answer

Using big integers with gmp and machine limits

I wonder if it is possible to use integers bigger than the value of .Machine$double.xmax (~1.79e308) in R. I thought that by using e.g. Rmpfr or gmp libraries in R you could assign values of any size, up to the limit of RAM on your system? I thought…
Simon O'Hanlon
  • 58,647
  • 14
  • 142
  • 184
4
votes
1 answer

fast arbitrary precision c++ library: is __float128 faster than MPFR?

I know there are a couple of thread on similar topics ( What's the best (for speed) arbitrary-precision library for C++? and The best cross platform (portable) arbitrary precision math library ) and I take from these threads than GMP or something…
fpghost
  • 2,834
  • 4
  • 32
  • 61
4
votes
2 answers

How to send GMP or MPFR types with MPI

I trying to send variables of type mpfr_t using MPI_Scatter. For example: mpfr_t *v1 = new mpfr_t[10]; mpfr_t *v2 = new mpfr_t[10]; MPI_Scatter(v1, 5, MPI_BYTE, v2, 5, MPI_BYTE, 0, MPI_COMM_WORLD ); for (int i = 0; i < 5; i++) …
Sidny Sho
  • 41
  • 1
3
votes
1 answer

gmpy2 mpfr values are limited to 301,033 digits of which the 301,032 digits are correct

I am writing a Python3 (64-bit) program to calculate pi to at least a million digits using the gmpy2 module on 64-bit Windows 10. I'm using the Chudnovsky algorithm. The series arithmetic is genius, easy to follow and straightforward to implement.…
stanely
  • 342
  • 1
  • 8
3
votes
1 answer

How to install Rmpfr on Ubuntu 18.04?

After install.packages("Rmpfr") I'm getting this error configure: error: Header file mpfr.h not found; maybe use --with-mpfr-include=INCLUDE_PATH ERROR: configuration failed for package ‘Rmpfr’ I typed the suggestion…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
3
votes
3 answers

GMPY2 doesn't install

EDIT: I'm using Win 10 and Ubuntu from the app store I have tried to install gmpy2 by using: apt-get install libgmp-dev apt-get install libmpfr-dev apt-get install libmpc-dev and also downloaded MPIR and compiled it. however using pip install gmpy2…
gypsyzz
  • 43
  • 1
  • 1
  • 6
1
2
3
13 14