how to find out if a double has decimal pieces

hey all!

Sory if im uncluear, i will try to explain the best i can.

Lets say there is a double:
double a;

lets say a = 1.70340
I want to make a function that finds doubles that dont have a decimal point and countains an integer, so if there was two doubles, one containing 1.5438 and the other containing 5, what function would i need to separate them?
have an int ans; and say ans= a +b which it will return an int.
There might be better solutions :

a == floor(a)

Please note that floating point operations are inaccurate, it is possible to have a non-integer result of an operation which should mathematically result in an integer.
Maybe a better solution :

abs(a - floor(a)) < epsilon

Where epsilon is a small number (the rounding error you allow) maybe 0.00001
Topic archived. No new replies allowed.