Jump to content
Sign in to follow this  
Jon

C++ Challenge

Recommended Posts

Jon

Can anyone think of a simple way to determine if any given double data type is a whole number or not?

e.g.

double dTest = 4294967306.22452

How can I test if dTest is a whole number or a floating point given that dTest is bigger than the long integer data type so you can't just convert double to long and back then compare.

I also don't want to use __int64 because it's freaky on MinGW

There's probably a simple solution I'm completely missing. Or maybe _int64 is the only way to go.

Share this post


Link to post
Share on other sites
Valik

Did you find a solution to this problem, Jon, or did you just use __int64 anyway?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.