Questions tagged [mpir]

MPIR (Multiple Precision Integers and Rationals) is an open source multiprecision integer (bignum) library forked from the GMP (GNU Multi Precision) project. It consists of much code from past GMP releases, in combination with much original contributed code. The basic interface is for C, but it also provides a C++ wrapper.

MPIR (Multiple Precision Integers and Rationals) is an open source multi-precision integer (bignum) library forked from the GMP (GNU Multi Precision) project. It consists of much code from past GMP releases, in combination with much original contributed code.

The basic interface is for C, but it also provides a C++ wrapper. The authors have, so far, preserved backwards compatibility with the GMP library.

38 questions
5
votes
1 answer

return mpz_t from a function

I am experiencing a problem while using mpir library in C++. Is it possible to return mpz_t value from a function? When I try to do it, I have the following error: RSA.cpp:50:36: error: ‘HASHtemp’ declared as function returning an array mpz_t…
adn
  • 53
  • 2
  • 3
4
votes
2 answers

Removing dependency on Windows SDK version

I'm trying to compile MPIR (Windows-friendly version of GMP). I have Visual Studio 2017 installed, so it should work, but I get this error message: C:\Program Files (x86)\Microsoft Visual…
rwallace
  • 31,405
  • 40
  • 123
  • 242
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
3
votes
0 answers

Mpir Windows build with --enable-gmpcompat?

Per mpir documentation, using --enable-gmpcompat switch when running ./configure will produce gmp.lib and gmp.h for compatibility. There is not a single word how to do that in Windows build though. How to do this in the Visual Studio project? I…
cen
  • 2,873
  • 3
  • 31
  • 56
2
votes
0 answers

Linker error when printing MPIR mpf_class

I am trying to use the MPIR library in a Qt Project. Here is a code snippet: #include #include #include "mpir.h" #include "mpirxx.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); mpf_class…
SASUPERNOVA
  • 141
  • 1
  • 11
2
votes
0 answers

Why is C# BigInteger faster than C++ MPIR?

I wrote a simple single-threaded application that checks whether a given number is prime. It is meant to support arbitrarily large integers, so I made use of the BigInteger class in C#. Here is the code: using System; using System.Diagnostics; using…
MathuSum Mut
  • 2,765
  • 3
  • 27
  • 59
2
votes
1 answer

Getting error C2177: constant too big with MPIR

Running on Widows 7 with MSVS 2010 I am following this tutorial to understand how to use MPIR library for adding two big integers I understand this library should help me in adding very big numbers as shown in the program below: #include <…
user3891236
  • 607
  • 1
  • 9
  • 23
1
vote
0 answers

Can't include MPIR library

I want to run a program, the compiler is crashing on the fact that it doesn't recognize the mpir.h include. I have used vcpkg to install mpir and did the vcpkg install integrate, to integrate it with Visual Studio. The program was normally with the…
Felix
  • 83
  • 2
  • 10
1
vote
0 answers

cannot do substraction in mpir

I am new to programming and I have a coding homework. We have to implement RSA using MPIR. I generated p and q the best way I could think of. I could not make them 512 bits, but I will continue as it is. I also did not test for primality yet. I will…
Cero
  • 11
  • 3
1
vote
1 answer

How to use MPIR Prime testers mpz_likely_prime_p and mpz_probable_prime_p?

I'm trying to use MPIR's prime tester(s) for rapid non-sequential testing; however, I'm new to MPIR and am confused about their usage - specifically the "gmp_randstate_t" parameter used by the function. Here's what I've got so…
JoshW
  • 83
  • 7
1
vote
2 answers

Trying to use Mpir.NET with F# on linux

I want to use Mpir.NET with F# (4.5) on Ubuntu 18.04, using dotnet on the command line. Not successful. If there is an easier way to use Mpir.NET on F# linux, please advise. Followed dotnet instructions…
DougT
  • 231
  • 1
  • 10
1
vote
0 answers

MPIR for VBA7 64 bit?

I am able to build MPIR with MSYS2 and Mingw-w64 with ./configure ABI=64 --prefix=/MPIR/MPIRinstall --build=skylakeavx-w64-mingw64 --disable-static --enable-shared --with-yasm=/usr/bin/yasm-1.3.0-win64.exe resulting in libmpir-23.dll. I have 64-bit…
1
vote
0 answers

VS2015 mpirxx error C4146

I am using Visual studio community 2015 and I want to set up a projects with mpirxx. Recently I' have compiled the mpirxx code to get the debug library file. In my project I have included the mpirxx.h file and linked mpirxx.lib, but when I try to…
user5806945
1
vote
0 answers

Remainder/Modulus with mpf's in MPIR

I am wondering what is the best possible way to check if a number is an integer (or super close to it) in MPIR. I am taking the square root of a number with mpf_sqrt() and then I want to check if the square root yields an integer. With java I use…
Seth Kitchen
  • 1,526
  • 19
  • 53
1
vote
1 answer

How much space to allocate in an mpz_t (MPIR)?

Supposing that I know how many digits my number might be (and I'd like to allocate the right amount of space the first time, how can I calculate the number of bytes I need to allocate? I suppose I could always set the value to be 1*10^(num digits)…
Maria
  • 565
  • 6
  • 20
1
2 3