| | Does anyone know how to determine if a given number is an integer
| | without using string functions?
|
| or if you're planning to use vb - you can just call the IsNumeric( )
| function
But IsNumeric will return true for both 3.14 and 3, while 3 is an
integer, but 3.14 is not.
One way to determine if a number is an Integer is to do something like:
If Convert.ToInt32(x) <> x then
'x is NOT an integer
Else
'Otherwise it is!
End If
This essentially truncates the value of x and then determines if the
truncated form equals the original form.