Raised This Month: $ Target: $400
 0% 

IS Integer?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 10-08-2007 , 14:48   IS Integer?
Reply With Quote #1

Hmm, been looking around and can't seem to find anything about this here.

Does anyone know of a way to find out if a float is an integer or not?

example:
15.1 - not an integer
15.0 - is an integer

Thanks
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
_Master_
Senior Member
Join Date: Dec 2006
Old 10-08-2007 , 14:50   Re: IS Integer?
Reply With Quote #2

if( var == floatround( var ) )
_Master_ is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 10-09-2007 , 19:44   Re: IS Integer?
Reply With Quote #3

if (floatfract(var) == 0.0) { /* is integer */ }
__________________
alien is offline
Send a message via ICQ to alien
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode