Does any one know of a complier that supports the 80 bit long double?? Or do you have any idea how to get one on VC++ 6.0
Thanks

Dani AI

Generated

Short answer for : VC++/MSVC (including the old VC6 Win32 toolchain) does not give you the hardware 80‑bit (x87) long double — on Win32 Microsoft maps long double to the 64‑bit double, so you can't get true 80‑bit long double simply by changing options in VC6. (msdn.microsoft.com)

If you want an 80‑bit long double implementation, use a compiler that targets the x87 extended format. GCC/Clang on x86 (or a Linux x86 build) expose the x87 80‑bit long double (the compiler also has switches to control the storage/alignment). On x86‑64 the ABI often pads that to 16 bytes for alignment but the extra precision is still the 80‑bit x87 value. (gcc.gnu.org) The Intel compiler on Windows can also emit 80‑bit long double with a compiler flag (but note the vendor warns about library/ABI implications). (intel.com)

Important caution for Windows users (this is the practical gotcha): mixing GCC/MinGW code that uses an 80‑bit long double with Microsoft runtime/library code (MSVCRT) can break formatted I/O and function calls because the runtimes disagree about the representation and calling conventions. If you go the GCC route on Windows prefer MSYS2/Cygwin builds or otherwise ensure the whole toolchain/runtime agree. Alternatively, use Intel's compiler for a more integrated Windows solution, or switch to a portable arbitrary‑precision library if you need reproducible, portable extra precision. (stackoverflow.com)

Tie‑backs: and were right that upgrading or using a third‑party math library are sensible options if changing toolchains is undesirable; ’s observation about sizeof(long double) differing between toolchains is exactly the behaviour you’ll see in practice. If experimenting, compile a tiny test with sizeof(long double) and std::numeric_limits<long double>::digits on the compiler you choose to confirm what you actually get before relying on it.

Recommended Answers

All 12 Replies

I don't know, but I'd definitely suggest trashing that old crap and getting a new compiler such as Visual Studio 2005 Express, or Dev-C++.

And if you need to hold huge numbers I'd suggest looking into a math library.

If long double doesn't do it, I'm not sure. If you desperately need the precision, you could also use a 3rd party high (or arbitrary) precision library.

Oh, and unless you absolutely need VC6.0, I'd recommend you upgrade to something from this millenium. There is a free version of VC available from Microsoft even ;)

[edit:] quite the race going on here :p

Well I am using VC 6.0 because it was given to me to learn c++, but according to
according to Microsoft they quit supporting the 80 bit long double when they started making 32 bit compilers, so getting a newer one from Microsoft will not do me any good.

Well I am using VC 6.0 because it was given to me to learn c++.

And it's fine for learning C++. It follows enough of the standard that you won't have to worry about it. Compilers aren't like stereo systems where you have to have the latest and greatest every year. VC6 is still in extensive use.

It still bugs me when people keep suggesting someone upgrade just because a new version comes out. That's not always recommended. For example, have you guys upgraded to Vista? XP is so old... :twisted:

On my system Dev-C++ IDE supports the long double data type and shows it 12 byte(96 bit) with sizeof();

For more information you can look at here:
http://en.wikipedia.org/wiki/Long_double

Are you using Dev-C++ ver 4. and should i be able to run both vc6 and Dev C++ 4 on the same computer and same hard drive partition.

and should i be able to run both vc6 and Dev C++ 4 on the same computer and same hard drive partition.

Yes, they are just two different applications that do the same thing. ;)

Are you using Dev-C++ ver 4. and should i be able to run both vc6 and Dev C++ 4 on the same computer and same hard drive partition.

Yes to all...

For example, have you guys upgraded to Vista? XP is so old... :twisted:

Sorry couldn't resist this... Is Vista free ? I guess no. Good compilers are not hard to get by, so the only reason for not upgrading would be laziness or some genuine project constraint....

Sorry couldn't resist this... Is Vista free ? I guess no. Good compilers are not hard to get by, so the only reason for not upgrading would be laziness or some genuine project constraint....

You missed my point completely :p

That being... :D

It still bugs me when people keep suggesting someone upgrade just because a new version comes out. That's not always recommended.

But I guess Walt's point was that Vista isn't the best upgrade choice right now, regardless of its price...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.