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
1 answer

Segmentation fault when reading matrix from file into Eigen mpfr

I have put together a basic C++ code which reads two matrices from text files into C++ and using the Eigen library solve the generalized eigenvalue problem. This works perfectly and gives me the expected results when using the data type double and…
Yeti
  • 425
  • 4
  • 15
0
votes
0 answers

Errors in mpreal.h when using mpfr

i'm trying to use mpfr with eigen (MPRealSupport) for some calculations. When i try to compile my prog in VS2010 (yes i know it's old, but i don't have any choice in the matter) i get the following errors (sorry they are in german. I can't change…
Myrkjartan
  • 166
  • 3
  • 16
0
votes
1 answer

insert mpfr_t object as value in a map

I am experiencing troubles to inserting an element of the type std::pair , mpfr_t> into the map. The std::make_pair function calls the error incompatible types in assignment of ‘__mpfr_struct*’ to ‘__mpfr_struct [1]’ Since I am only passing a…
0
votes
1 answer

How to extend the precision of mpreal precisely?

Consider the following code: #include #include using namespace std; using mpfr::mpreal; mpreal x("1.001",64); mpreal y("1.0",64); y*=x; cout<
sunhex
  • 53
  • 5
0
votes
1 answer

Multiple precision elementary functions implementation

I'm trying to find an implementation of a multiple precision version of the sin functions. I'm trying to read through the mpfr library (the C/C++ source code) but I can't find any code related to the actual implementation. What I basically want to…
user8469759
  • 2,522
  • 6
  • 26
  • 50
0
votes
1 answer

Dynamically Allocated mpfr_t matrix with std::vector

I want to have a class that works as a matrix of mpfr_t elements. I thought STL Vectors would be a great idea for dynamically allocating as many of these as I want, but I get some errors here. #ifndef GMPMATRIX_H #define GMPMATRIX_H #include…
p0licat
  • 45
  • 1
  • 10
0
votes
1 answer

C++ MPFRC++ How to use memcpy() with mpfr::mpreal?

I couldn't find anything related to this question. Suppose I have two mpfr::mpreal arrays, a and b, in the heap, as new mpfr::mpreal[n]. I have to use C-style arrays because of a function that calls and uses the arrays. I can't modify it, I tried,…
a concerned citizen
  • 787
  • 2
  • 9
  • 25
0
votes
1 answer

MPFR C++ Print floating point numbers like integers

Having just succeeded in compiling a program using MPFR C++ (1st time), I need to print out some fairly large numbers, but they only come out as engineering notations instead of the whole numbers. From what I read, the library is not optimized for…
a concerned citizen
  • 787
  • 2
  • 9
  • 25
0
votes
2 answers

Print to file from MPFR

I want to print the result of a calculation using MPFR to file but I don't know how. MPFR is used to do floating point operations with high accuracy. To print an mpfr_t number you use the function: size_t mpfr_out_str (FILE *stream, int base, size t…
R.Mckemey
  • 335
  • 1
  • 3
  • 14
0
votes
1 answer

exp function in Julia evaluating to 0

I want to calculate and plot the probability density of a wave function in Julia. I wrote a small snippet of Julia code for evaluating the following function: The Julia (incomplete) code is: set_bigfloat_precision(100) A = 10 C = 5 m =…
0
votes
1 answer

gcc 6.1. installation, gmp/mpfr/mpc not built?

I've recently installed the gcc 6.1, specifically for the libraries mentioned in the title (gmp/mpfr/mpc) I followed what the gnu website said: GNU Multiple Precision Library (GMP) version 4.3.2 (or later) Necessary to build GCC. If a GMP source…
user8469759
  • 2,522
  • 6
  • 26
  • 50
0
votes
0 answers

How to translate the Expr(Const number) in Z3 to be an object in MPQ/MPFR

When I use the Z3-opt(Ocaml version) to solve some planning problem, and I get a result from Z3 like this: (+ (/ 31.0 10.0) (* (to_real (- 1)) epsilon)) And this result is of type of Z3.Expr. I want to know how to translate this result(of Z3.Expr)…
redder
  • 1
0
votes
0 answers

Errors when cross compiling GMP

I have followed this How-to and g,h section of cross compiling tutorial for cross compiling GMP. This is the error message(last part) I get after running make. /usr/bin/ld: skipping incompatible /home/yogi/workbench/gcc-4.8.2/arm/lib/libmpfr.so when…
re3el
  • 735
  • 2
  • 12
  • 28
0
votes
1 answer

MPFR Program Crashes With High Precision

I recently wrote a program to calculate pi to a specified number of digits. The number of digits must be passed as the first command line argument. When run with a digit value under about 300 it works just fine. However, when run with a larger digit…
0
votes
1 answer

Issue with link library when compiling with cmake

I can compile a cpp file with g++ using the command: g++ test.cpp -lmpfr -lgmp How to add these libraries to a CMakeLists.txt to compile with CMake?