Page 1 of 1

Need C# help

Posted: Mon Jan 26, 2009 3:57 pm
by batman113
Hi,
Im making a prime number checker and i need to be able to check if a number is an integer or not. Has anyone got any ideas how?
Thanks

Re: Need C# help

Posted: Mon Jan 26, 2009 4:31 pm
by uncle_fungus
Math.Floor(x) == x

Returns true if x is an int, false otherwise.

Google is your friend ;)

Re: Need C# help

Posted: Mon Jan 26, 2009 5:43 pm
by batman113
Thanks
i searched for ages and couldnt find what i was looking for but thanks!