|
-
December 6th, 2011, 09:09 AM
#6
Re: Cleanest way to check if a number is an integer.
Only use floating point numbers if you're ok with the inaccuracy they will give you. You will get false positives and negatives for certain number combinations. If you want accuracy you should use the modulus operator to see if the number is exactly divisible.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
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
|