printf and 'long double'

S

saper

I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error
 
I

Ioannis Vranos

saper said:
I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error


Unfortunately, MINGW has problem with long double. It is a compiler bug,
which probably is not going to be fixed too.

Consult MINGW users mailing list if you want to more information on this
and to discuss it more.
 
S

saper

Thanks
but when I use
cout << ld
It is OK


Ioannis Vranos said:
Unfortunately, MINGW has problem with long double. It is a compiler bug,
which probably is not going to be fixed too.

Consult MINGW users mailing list if you want to more information on this
and to discuss it more.
 
I

Ioannis Vranos

saper said:
Thanks
but when I use
cout << ld
It is OK


It isn't for much large values:


#include <limits>
#include <cfloat>
#include <iostream>


int main()
{
using namespace std;

long double ld= numeric_limits<long double>::max();

cout<<ld<<"\n";


ld= LDBL_MAX;

cout<<ld<<"\n";
}


C:\c>temp
1.#INF
1.#INF

C:\c>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top