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

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

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

    saper Guest

    but when I use
    cout << ld
    It is OK

    saper, Feb 25, 2005

  5. 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();


    ld= LDBL_MAX;



    Ioannis Vranos, Feb 25, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.