Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

long doubles

Name: Anonymous 2011-08-13 11:42


int main(void)
{
    long double test = 1;
    test <<= 1E1L;
    return 0;
}

test@test:~/test$ gcc -ansi -pedantic -Wall -O0 -o test test.c
test.c: In function ‘main’:
test.c:35:7: error: invalid operands to binary << (have ‘long double’ and ‘long double’)


So there is no way I can bit-shift the damn long double's?

Name: Anonymous 2011-08-13 13:31

Ha ha! I thought of this.

union loldouble {
    struct{
        unsigned long int a;
        unsigned long int b;
    } c;
    long double d;
} l_dbl;
l_dbl.c.a = 12;
l_dbl.c.b = 13;

printf("the long double value is: %LG\n",l_dbl.d);


Now I can use the damn bit-shifts.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List