home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / lang / Float.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  2.2 KB  |  89 lines

  1. package java.lang;
  2.  
  3. public final class Float extends Number {
  4.    public static final float POSITIVE_INFINITY = InfinityF;
  5.    public static final float NEGATIVE_INFINITY = -InfinityF;
  6.    public static final float NaN = NaNF;
  7.    public static final float MAX_VALUE = 3.4028235E38F;
  8.    public static final float MIN_VALUE = 1.4E-45F;
  9.    public static final Class TYPE = Class.getPrimitiveClass("float");
  10.    private float value;
  11.    private static final long serialVersionUID = -2671257302660747028L;
  12.  
  13.    public static String toString(float var0) {
  14.       return (new FloatingDecimal(var0)).toJavaFormatString();
  15.    }
  16.  
  17.    public static Float valueOf(String var0) throws NumberFormatException {
  18.       return new Float(Double.valueOf0(var0));
  19.    }
  20.  
  21.    public static boolean isNaN(float var0) {
  22.       return var0 != var0;
  23.    }
  24.  
  25.    public static boolean isInfinite(float var0) {
  26.       return var0 == POSITIVE_INFINITY || var0 == NEGATIVE_INFINITY;
  27.    }
  28.  
  29.    public Float(float var1) {
  30.       this.value = var1;
  31.    }
  32.  
  33.    public Float(double var1) {
  34.       this.value = (float)var1;
  35.    }
  36.  
  37.    public Float(String var1) throws NumberFormatException {
  38.       this(valueOf(var1));
  39.    }
  40.  
  41.    public boolean isNaN() {
  42.       return isNaN(this.value);
  43.    }
  44.  
  45.    public boolean isInfinite() {
  46.       return isInfinite(this.value);
  47.    }
  48.  
  49.    public String toString() {
  50.       return String.valueOf(this.value);
  51.    }
  52.  
  53.    public byte byteValue() {
  54.       return (byte)((int)this.value);
  55.    }
  56.  
  57.    public short shortValue() {
  58.       return (short)((int)this.value);
  59.    }
  60.  
  61.    public int intValue() {
  62.       return (int)this.value;
  63.    }
  64.  
  65.    public long longValue() {
  66.       return (long)this.value;
  67.    }
  68.  
  69.    public float floatValue() {
  70.       return this.value;
  71.    }
  72.  
  73.    public double doubleValue() {
  74.       return (double)this.value;
  75.    }
  76.  
  77.    public int hashCode() {
  78.       return floatToIntBits(this.value);
  79.    }
  80.  
  81.    public boolean equals(Object var1) {
  82.       return var1 != null && var1 instanceof Float && floatToIntBits(((Float)var1).value) == floatToIntBits(this.value);
  83.    }
  84.  
  85.    public static native int floatToIntBits(float var0);
  86.  
  87.    public static native float intBitsToFloat(int var0);
  88. }
  89.