[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sizeof (long long double) < sizeof (long double)


 $ g++ -Wall prog.cpp

 prog.cpp is as follows:


#include <iostream>

using namespace std;

int main()
    cout << "float: "            << sizeof(float)            << '\n';
    cout << "double: "           << sizeof(double)           << '\n';
    cout << "long double: "      << sizeof(long double)      << '\n';
    cout << "long long double: " << sizeof(long long double) << '\n';

    return (0);


 Output is:


float: 4
double: 8
long double: 12
long long double: 8


 Is that what to expect of long long double?

 Trying to understand C++. Sorry if the question is dumb, but I can't
understand long long double being shorter than long double. Bug or
the right thing?

 This seems to be a list and if so I'm not on it. Please, cc any replies
on this thread.

 Running on a intel P4, debian unstable.
 g++ --version is as follows:

 g++ (GCC) 3.3.3 (Debian 20040401)



Reply to: