|
-
October 20th, 2009, 11:58 PM
#1
identifying integer assigned to double, how to?
hi,
The code iam working on accepts numeric input from the user and stores it into a double variable. The user can enter either floating point numbers or integers. How do i identify if the user has entered a floating point type or an integer type?
I've thought up the following code to figure out if the given number is of floating point type:
Code:
if( floor (doublevar) < doublevar )
//doublevar is of floating point type
this seems to work fine, is it correct? How do i check if the given number if of integer type?
thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|