home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / kaffe-0.5p4-src.tgz / tar.out / contrib / kaffe / test / floats / inf.java < prev    next >
Text File  |  1996-09-28  |  808b  |  33 lines

  1. public class inf {
  2.     public static void main(String[] args)
  3.     {
  4.         double big = Double.POSITIVE_INFINITY, small = Double.NEGATIVE_INFINITY;
  5.         System.out.println("Does this interpreter work for positive infinity?");
  6.         if (1.0 < big)
  7.         {
  8.             System.out.println("Yes!");
  9.         }
  10.         else
  11.         {
  12.             System.out.println("No!");
  13.         }
  14.         System.out.println("How about negative infinity?");
  15.         if (1.0 > small)
  16.         {
  17.             System.out.println("Yes!");
  18.         }
  19.         else
  20.         {
  21.             System.out.println("No!");
  22.         }
  23.         if (Double.isNaN(big))
  24.         {
  25.             System.out.println("+Inf is NaN");
  26.         }
  27.         if (Double.isNaN(small))
  28.         {
  29.             System.out.println("-Inf is NaN");
  30.         }
  31.     }
  32. }
  33.