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
0
votes
0 answers

MPFR library: How can you add two mprf_t variables and print the result?

I'm searching for some example illustrating the mpfr library but I can't find anything useful. I would like to create two variables that can hold up to 100 digits of a floating number. These variables must be initialized using a string. Then I would…
jsguy
  • 2,069
  • 1
  • 25
  • 36
0
votes
2 answers

Installing GCC 4.8.2 on Red Hat Enterprise linux 6.5

I am new to Red Hat Enterprise linux. I am facing issues while compiling gcc 4.8.2 on Red Hat Enterprise Linux 6.5 I down;oaded the source code from GNU webite. I followed steps from this link http://gcc.gnu.org/wiki/InstallingGCC Commands fired…
Dhiraj
  • 257
  • 1
  • 5
  • 13
0
votes
1 answer

mpfr(0.5) invalid floating point operation

I hope I am not pointing out something obvious, or that the fix to this is not obvious. I am using gmpy2 2.0.3 on a 64 bit windows 7 machine, coding with PyScripter. The following code gives an "Invalid floating point operation" error, from gmpy2…
0
votes
1 answer

Using MPFR And Adding - How many Digits are Correct?

I have a pretty easy question (I think). As much as I've tried, I can not find an answer to this question. I am creating a function, for which I want the user to enter two numbers. The first is the the number of terms of a certain infinite series…
Rick Farr
  • 3
  • 1
0
votes
2 answers

Error while install gcc49 in Ubuntu by using linuxbrew

I want to install the latest gcc49 in a Ubuntu Linux, and I am familiar with Homebrew in Mac, so I would like to use the Linux version of it, i.e., Linuxbrew. So I installed Linuxbrew and typed $ brew install gcc49 The dependencies gmp4, mpfr2 and…
Li Dong
  • 1,088
  • 2
  • 16
  • 27
0
votes
1 answer

configure error for mpfr-3.1.2 missing libgmp but is is in the /usr/lib

I am on step 6.15.1 on linux from scratch. When I am trying to configure the mpfr I am getting an error ... checking for __gmpz_init in -lgmp... no configure: error: libgmp not found or uses a different ABI (including static vs shared). Please read…
penright
  • 163
  • 4
  • 12
0
votes
0 answers

Re-using mpfr_t in long chain of arithmetic operations

I'm writing a function which uses mpfr_t as its main data type. In this function, there will be long chains of operations which need temporary variables to store intermediate results. I'd like to minimize the number of temporary variables I'll need,…
pg1989
  • 1,010
  • 6
  • 13
0
votes
1 answer

How to deploy a portable gcc with cloog?

I'm trying to build a portable version of gcc 4.8.2. (for only C/C++ languages) The end result is have gcc installed into a specific application directory, eg, /opt/gcc-4.8.2 so that I can copy that directory from one computer to another (all…
Darren Smith
  • 2,261
  • 16
  • 16
0
votes
0 answers

Is it possible to simplify value creation/usage in MPFR?

Suppose that I want to use MPFR to compute pi; I have the following code, which works: mpfr_t PI; mpfr_t one; mpfr_init(PI); mpfr_init(one); mpfr_set_d(one, 1, MPFR_RNDN); mpfr_asin(PI, one, MPFR_RNDN); mpfr_mul_d(PI, PI, 2, MPFR_RNDN); This is…
Eric Tressler
  • 375
  • 1
  • 11
0
votes
1 answer

An error when installing MPFR (3.1.0)

I am trying to install MPFR (3.1.0) with the instructions from this link (part 3) and I get the following error: checking for gmp internal files... configure: error: header files gmp-impl.h and longlong.h not found I have already installed gmp…
Belgi
  • 14,542
  • 22
  • 58
  • 68
0
votes
2 answers

long long int on 32-bit Linux vs 64-bit Linux and MPFR

How exactly does a 32-bit Linux system handle long long int compared to 64-bit Linux? On my 32 bit system I use a C++ wrapper for the MPFR data type; this wrapper has a constructor defined for long int but not long long int. Nevertheless, on the…
fpghost
  • 2,834
  • 4
  • 32
  • 61
0
votes
1 answer

gcc 4.7.1 build ends with undefined reference

I am getting a fortran/arith.o: In function gfc_mpfr_to_mpz(__mpz_struct*, __mpfr_struct*, locus*)': arith.c:(.text+0x1169): undefined reference tompfr_get_z_2exp' from gcc 4.7.1 build process. I am following gcc-wiki However, I have made a…
Umut Tabak
  • 1,862
  • 4
  • 26
  • 41
0
votes
2 answers

what is precision?

I haven't been able to find an answer on Wikipedia (or SO) or in the documentation for this very simple question. How is the precision of a floating point number represented by an integer? I am using the wrapper MPFRC++ over the arbitrary precision…
cmo
  • 3,762
  • 4
  • 36
  • 64
-1
votes
0 answers

I have a segmentation error in a program that generates mandelbrot fractal with mpfr

Recently I modified my mandelbrot fractal generation program to be able to integrate gmp and mpfr in order to zoom deeper into the fractal. But since I did this I have a segmentation error when I try to run the program I’m pretty new to c language…
ena0
  • 1
  • 1
-1
votes
2 answers

What is the type of mpfr_t and how do I make a C function of this type?

I've just started using the GMP and MPFR. I'm writing a program in C and would like to make a function that (for example) takes as input an mpfr_t variable and returns an mpfr_t variable. I'm not sure of the definition of mpfr_t, but I tried naively…
1 2 3
13
14