Are you asking:
If you have a value in a variable that can hold fractional numbers (i.e. a float in C-like languages), but you have no function like "bool IsInteger(float)" in your libraries to determine if that number has a fractional part... how would you figure that out mathematically?

Most languages truncate on float point to integer type conversions, so usually you can do something like:

If you were using C (or a derivative), you could just use strtol. For the last parameter, pass in a char * (it doesn't have to actually point to anything at the beginning), and if at the end it isn't pointing to NULL, it's not a string. (hooray for actually learning something in the programming assignment I was working on today )