Jump to content

C++ Challenge


Jon
 Share

Recommended Posts

  • Administrators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...