Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
There is a big int library I want to download GitHub - sercantutar/infint: Arbitrary-Precision Integer Arithmetic[^] , but I'm not sure on how to use it after downloading. I recently had this problem with PDcurses, so I thought I'd ask first.

What I have tried:

I would try including the header file, but I'm pretty sure there is more than that to it, like path variables or something. I'm using CodeBlocks with MinGW 64, if that helps.
Posted
Updated 5-Mar-21 2:21am
v2

Check the documentation on the project.

If the documentation doesn't answer your question, then post an issue in that project.

If you still don't get an answer, then use a library which is properly documented and supported instead.
 
Share this answer
 
Did you even read the 1st paragraph of the repository that you posted?

It says 'InfInt is simply a lightweight large integer library which consists of a header file. So, all you have to do is to include the header file provided and start using huge integers in your applications.'

What you need to do is to add InfInt.h to your project and include the InfInt.h to start using. There is no library to be built or added to your project.

C++
#include "InfInt.h"
 
Share this answer
 
It will depend on what you download. If it is a pre-built* library then you just need to install it somewhere on your system. You can then use the relevant environment or IDI settings to provide the path locations for your build system. You need to include the header file in your source in order to tell the compiler how to translate your code. You need to add the library name to your linker options to tell the linker how to handle the references to items in the library.

*if the library download is source code only then you will need to consult the documentation to find out how to build it.
 
Share this answer
 
Comments
Captian Ahab 4-Mar-21 12:45pm    
I didn't see anything explaining how to build it.
Richard MacCutchan 4-Mar-21 15:13pm    
Then I am afraid you will have to figure it out yourself unless yo can find something on Google to help you.
Quote:
There is a big int library I want to download GitHub - sercantutar/infint: Arbitrary-Precision Integer Arithmetic

Beware, there is a catch.
If you just want to be able to handle a few BigInts, very nice.
If you want to do intensive BigInts calculations, very bad.
The library is only high level C++, which is very nice, it should work about anywhere, but it is not efficient.
In matter of MP (Multi Precision), the necessary tools are processor specific (internal flags like the carry), which means that code for x64 works only on the family of processors, and you need other code for ARM ...

I wouldn't be surprised if this library is 10 times slower, on simple operations like addition, than the optimized libraries like The GNU MP Bignum Library. On more complex operation, it is worse.

Arbitrary-precision arithmetic - Wikipedia[^]
This library look more complicated to start with, but is much more efficient : The GNU MP Bignum Library[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900