Computing.Net > Forums > Programming > double and long double in C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

double and long double in C++

Reply to Message Icon

Name: jackwong
Date: August 22, 2005 at 12:47:38 Pacific
OS: winXP Pro.
CPU/Ram: 521MB
Comment:

Hello,

I want to demostrate the difference between double and long double in C++, but here is what I got:

double d = 0.88 ^5000;
long double dl = 0.88^ 5000;

it ended up "d" and "dl" give the same number, but I was expecthing they are little different, because long double can store a wider range number than double, please help!

thanks,


Jack



Sponsored Link
Ads by Google

Response Number 1
Name: Guy
Date: August 23, 2005 at 11:25:01 Pacific
Reply:

I suspect that is correct behaviour for a 32 bit architecture implementation.

Depending on the compiler, there may be compile options/switches that can change this behavior.

Guy


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: double and long double in C++

Making and deleting folders in C++ www.computing.net/answers/programming/making-and-deleting-folders-in-c/3490.html

Yes and NO keys in C www.computing.net/answers/programming/yes-and-no-keys-in-c/2493.html

Segment and Offset Address in C www.computing.net/answers/programming/segment-and-offset-address-in-c/764.html