Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > printf and 'long double'

Reply
Thread Tools

printf and 'long double'

 
 
saper
Guest
Posts: n/a
 
      02-24-2005
I use dev-cpp
and use 'long double'
How show this variable in function
printf ("%Lg",ld) is error


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      02-24-2005
saper wrote:
> I use dev-cpp
> and use 'long double'
> How show this variable in function
> printf ("%Lg",ld) is error


What error?
 
Reply With Quote
 
 
 
 
Ioannis Vranos
Guest
Posts: n/a
 
      02-25-2005
saper wrote:

> 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.




--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
saper
Guest
Posts: n/a
 
      02-25-2005
Thanks
but when I use
cout << ld
It is OK


"Ioannis Vranos" <(E-Mail Removed)> wrote in message
news:1109326105.127718@athnrd02...
> saper wrote:
>
>> 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.
>
>
>
>
> --
> Ioannis Vranos
>
> http://www23.brinkster.com/noicys



 
Reply With Quote
 
Ioannis Vranos
Guest
Posts: n/a
 
      02-25-2005
saper wrote:

> 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>



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
printf affects following printf/s azza C Programming 0 10-17-2010 09:43 AM
Extracting printf(...) from (void) printf(....) guru Perl Misc 8 02-03-2009 10:37 PM
(void) printf vs printf whatluo C Programming 29 09-08-2005 05:42 PM
bus error with printf line included, error without printf line? ben C Programming 4 06-26-2004 04:42 PM
How to open a new console and write something out write printf() Peter Hansen C++ 1 08-24-2003 11:49 AM



Advertisments