intermediate/StrangeDoubles

From ggc

Jump to: navigation, search

01 package intermediate;
02 
03 import wiki.Wiki;
04 /**
05  * All about my application here.
06  @author Jam Jenkins
07  */
08 public class StrangeDoubles
09 {
10   public static void main(String[] args)
11   {
12     double x=4.5;
13     if(Double.isNaN(x))
14       Wiki.out.println(x+" is not a number.");
15     else
16       Wiki.out.println(x+" is a number");
17     if(x==5)
18       Wiki.out.println("They are the same");
19     else
20       Wiki.out.println("They are different");
21   }
22 }


Download/View intermediate/StrangeDoubles.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter