Higher precision than double possible?

Mar 12, 2012 at 8:09pm
I'm using Visual Studio 2010 Professional C++.
I understand that double occupies 8 bytes.
Long double is a myth and isn't more precise because it also occupies 8 bytes.
How can I get higher precision?
I don't think quad is supported.
Is there some library or class that uses two doubles to represents a single number?
Then a whole new method would be needed to add, subtract, multiply, & divide.
Mar 12, 2012 at 8:14pm
You can go find many libs that provide arbitrary precision numbers. Do a search for "BigNum" or something like that.
Mar 12, 2012 at 8:46pm
I think the biggest floating point representation in MSVC is long double (80-bit)
Mar 12, 2012 at 8:47pm
You may find this useful:

http://gmplib.org/
Mar 12, 2012 at 9:43pm
GMP is exactly what I needed.
How do you install it?
The section in the manual for installation was terrible.
If you have a Unix-like system, then so and so.
What about Windows? Visual Studio 2010?
Is there a step-by-step installation instructions and examples of usage?
Mar 12, 2012 at 11:10pm
Since it's open source/GNU (ugh...) try doing what you should do with all open source projects that you want to use.
Download the source code, decompress it, extract it from the tar, and build it as a DLL. If there is a problem with building it, make sure you have the source files compatible with the system and compiler you are building it on and complain to the GNU community in their forums.

After that, put it in a folder for any libraries you may eventually use, and any time you need to use it in Visual Studio adjust the project properties to reference the headers and dynamically link it to the DLL.
Make sure that whatever computer it ends up on has a build of the DLL.
Also be sure to follow the license. In this case, you would need to follow the LGPL. Good luck.
Topic archived. No new replies allowed.