printf and 'long double'

Discussion in 'C++' started by saper, Feb 24, 2005.

  1. saper

    saper Guest

    I use dev-cpp
    and use 'long double'
    How show this variable in function
    printf ("%Lg",ld) is error
     
    saper, Feb 24, 2005
    #1
    1. Advertising

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


    What error?
     
    Victor Bazarov, Feb 24, 2005
    #2
    1. Advertising

  3. 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
     
    Ioannis Vranos, Feb 25, 2005
    #3
  4. saper

    saper Guest

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


    "Ioannis Vranos" <> 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
     
    saper, Feb 25, 2005
    #4
  5. 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
     
    Ioannis Vranos, Feb 25, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sydex
    Replies:
    12
    Views:
    6,652
    Victor Bazarov
    Feb 17, 2005
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,248
    Peter Shaggy Haywood
    Sep 20, 2005
  3. fieldfallow

    printf() error with long double and null pointer.

    fieldfallow, Feb 24, 2006, in forum: C Programming
    Replies:
    69
    Views:
    1,794
    Jordan Abel
    Feb 28, 2006
  4. Zero

    "long double" and "printf"

    Zero, Jun 6, 2006, in forum: C Programming
    Replies:
    12
    Views:
    1,423
    Richard Bos
    Jun 8, 2006
  5. Hans Vlems

    long long int and sscanf, printf

    Hans Vlems, Sep 7, 2012, in forum: C Programming
    Replies:
    5
    Views:
    1,719
    Hans Vlems
    Sep 7, 2012
Loading...

Share This Page