Need C# help

Please confine these topics to things that would be of general interest to those who are interested in FAH which don't fall into any other category.

Moderator: Site Moderators

Need C# help

Postby batman113 » Mon Jan 26, 2009 3:57 pm

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
batman113
 
Posts: 58
Joined: Fri Nov 07, 2008 9:46 pm

Re: Need C# help

Postby uncle_fungus » Mon Jan 26, 2009 4:31 pm

Math.Floor(x) == x

Returns true if x is an int, false otherwise.

Google is your friend ;)
User avatar
uncle_fungus
Site Admin
 
Posts: 1682
Joined: Fri Nov 30, 2007 9:37 am
Location: Oxfordshire, UK

Re: Need C# help

Postby batman113 » Mon Jan 26, 2009 5:43 pm

Thanks
i searched for ages and couldnt find what i was looking for but thanks!
batman113
 
Posts: 58
Joined: Fri Nov 07, 2008 9:46 pm


Return to Scientific discussions (Non-FAH)

Who is online

Users browsing this forum: No registered users and 1 guest

cron