View Single Post
  #5 (permalink)  
Old 01-03-2008, 01:16 AM
roots's Avatar
roots roots is offline
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 263
roots is on a distinguished road
Correct me if i am wrong

Code:
public class demo { public static void main(String[] args) { assert isInt(2.2) ; assert ! isInt(2.0) ; System.out.println("Passed simple test"); } public static boolean isInt(double number){ return ((Math.floor(number) - number ) == 0.0); } }
__________________
dont worry newbie, we got you covered.
Reply With Quote