209 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
41
views
How to change `MPFR_MAX_PREC` either via `R` or a re-compile?
The default value (in bits, I believe), as shown via Rmpfr:
.mpfr_maxPrec()
[1] 9.223372e+18
I'd like to find a way to change that value to something larger. Here's a real-world example where it ...
0
votes
1
answer
53
views
How to build an exact MPFR number using gmpy2?
I believe that the result of any MPFR computation, whatever rounding mode or precision has been selected to obtain it, is (the memory representation of) an exact binary number, of the form m*2^e, ...
0
votes
0
answers
349
views
cannot install gcc on almaLinux release 9.3
I am not able to install gcc on my network switch (64-bit machine) for an application that needs to be compiled on the switch (running the following redhat version.)
[admin@sw ~]$ cat /etc/redhat-...
0
votes
0
answers
159
views
CMake: Error linking GMP and MPFR on Ubuntu
I'm running Ubuntu (24.04) and am trying to compile a C++ project using the GMP and MPFR library. I have the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.29)
project(find_gmp)
set(...
1
vote
1
answer
79
views
mpfr_t in custom MPI structs
I am working on converting my program to use arbitrary precision and thus I started utilizing MPFR. I had a custom MPI struct containing my data in my original code. Now that I have converted my data ...
2
votes
0
answers
69
views
what is the function `seq()` doing with mpfr objects?
Consider the following:
>> library(Rmpfr)
>> seq(mpfr(1,10),mpfr(5,10),by=1)
5 'mpfr' numbers of precision 10 bits
[1] 1 2 3 4 5
>> seq(1,mpfr(5,10),by=1)
[[1]]
[1] 1
[[2]]
[1] ...
0
votes
2
answers
65
views
Code generation - custom floating point type
I'm using sympy to generate c++ that evaluate a polynomial whose coefficients are expressed as fractions of very large integers.
I would like to use MPFR to represent theses coefficients.
Is it ...
2
votes
2
answers
97
views
How to write c language modulo 2 with use mpfr function?
Here is the example of code in c language:
int i;
for (i=0; i < 100; i++)
{
if (i % 2 == 0)
{
// do something
}
}
But i variable is standard integer. I need this code of modulo 2 with use mpfr_t ...
1
vote
0
answers
370
views
How to install GMP and MPFR libraries for C on Windows?
I want to install GMP and MPFR libraries for calculating arbitrarily high value numbers, but their manual has no instructions for Windows. For example, https://gmplib.org/manual/Installing-GMP. Is ...
1
vote
0
answers
71
views
How to rewrite my CPILL procedure to calculate Pi value, with use multithreading to shorten the time of calculation?
I have written procedure in C language with use MPFR library. This procedure is using Leibniz formula to compute Pi.
This is console CLI application. The aim of this app is to reach the maximum ...
1
vote
0
answers
197
views
mpfr.h file not found after installation
I'm trying to install some software that has dependencies on GMP and mpfr on a Mac OS machine. After installing every dependency with homebrew and trying to run the makefile it says fatal error: 'mpfr....
0
votes
1
answer
42
views
Why there is no mpfr_sub_sj (while there is mpfr_set_sj_2exp)?
A simple question: why there is no mpfr_sub_sj (while there is mpfr_set_sj_2exp)?
More details: for mpfr_set_xx_2exp there are sj and uj variants:
$ grep -P 'int mpfr_set_.*_2exp' mpfr.h
...
pmor's user avatar
- 6,795
0
votes
1
answer
63
views
Are there predicate functions to compare mpfr_t with double?
There are predicate functions to compare mpfr_t with mpfr_t. For example:
int mpfr_greaterequal_p (mpfr_t op1, mpfr_t op2)
int mpfr_lessequal_p (mpfr_t op1, mpfr_t op2)
Are there predicate functions ...
pmor's user avatar
- 6,795
0
votes
1
answer
42
views
What is the semantics of return values of assignment functions?
In MPFR's documentation (both HTML and PDF) I cannot find the semantics of return values of assignment functions. For example, what is the meaning of return value of mpfr_set?
Extra: quite surprised ...
pmor's user avatar
- 6,795
1
vote
2
answers
96
views
How to compute DECIMAL_DIG from value returned by mpfr_get_prec()?
Context: C standard has xxx_DECIMAL_DIG macros, which can be used in printf to maintain precision of floating-point value. Example for double:
printf("%.*g\n", DBL_DECIMAL_DIG, x);
A ...