IT. Expert System.

Android Reference

Float


java.lang

Class Float

    • Field Summary

      Fields
      Modifier and Type Field and Description
      static int MAX_EXPONENT
      Maximum base-2 exponent that a finite value of the float type may have.
      static float MAX_VALUE
      Constant for the maximum float value, (2 - 2-23) * 2127.
      static int MIN_EXPONENT
      Minimum base-2 exponent that a normal value of the float type may have.
      static float MIN_NORMAL
      Constant for the smallest positive normal value of the float type.
      static float MIN_VALUE
      Constant for the minimum float value, 2-149.
      static float NaN
      Constant for the Not-a-Number (NaN) value of the float type.
      static float NEGATIVE_INFINITY
      Constant for the negative infinity value of the float type.
      static float POSITIVE_INFINITY
      Constant for the positive infinity value of the float type.
      static int SIZE
      Constant for the number of bits needed to represent a float in two's complement form.
      static Class<Float> TYPE
      The Class object that represents the primitive type float.
    • Constructor Summary

      Constructors
      Constructor and Description
      Float(double value)
      Constructs a new Float with the specified primitive double value.
      Float(float value)
      Constructs a new Float with the specified primitive float value.
      Float(String string)
      Constructs a new Float from the specified string.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      byte byteValue()
      Returns this object's value as a byte.
      static int compare(float float1, float float2)
      Compares the two specified float values.
      int compareTo(Float object)
      Compares this object to the specified float object to determine their relative order.
      double doubleValue()
      Returns this object's value as a double.
      boolean equals(Object object)
      Tests this double for equality with object.
      static int floatToIntBits(float value)
      Returns an integer corresponding to the bits of the given IEEE 754 single precision float value.
      static int floatToRawIntBits(float value)
      Returns an integer corresponding to the bits of the given IEEE 754 single precision float value.
      float floatValue()
      Gets the primitive value of this float.
      int hashCode()
      Returns an integer hash code for this object.
      static float intBitsToFloat(int bits)
      Returns the IEEE 754 single precision float corresponding to the given bits.
      int intValue()
      Returns this object's value as an int.
      boolean isInfinite()
      Indicates whether this object represents an infinite value.
      static boolean isInfinite(float f)
      Indicates whether the specified float represents an infinite value.
      boolean isNaN()
      Indicates whether this object is a Not-a-Number (NaN) value.
      static boolean isNaN(float f)
      Indicates whether the specified float is a Not-a-Number (NaN) value.
      long longValue()
      Returns this object's value as a long.
      static float parseFloat(String string)
      Parses the specified string as a float value.
      short shortValue()
      Returns this object's value as a short.
      static String toHexString(float f)
      Converts the specified float into its hexadecimal string representation.
      String toString()
      Returns a string containing a concise, human-readable description of this object.
      static String toString(float f)
      Returns a string containing a concise, human-readable description of the specified float value.
      static Float valueOf(float f)
      Returns a Float instance for the specified float value.
      static Float valueOf(String string)
      Parses the specified string as a float value.
    • Field Detail

      • MAX_VALUE

        public static final float MAX_VALUE
        Constant for the maximum float value, (2 - 2-23) * 2127.
        See Also:
        Constant Field Values
      • MIN_VALUE

        public static final float MIN_VALUE
        Constant for the minimum float value, 2-149.
        See Also:
        Constant Field Values
      • NaN

        public static final float NaN
        Constant for the Not-a-Number (NaN) value of the float type.
        See Also:
        Constant Field Values
      • POSITIVE_INFINITY

        public static final float POSITIVE_INFINITY
        Constant for the positive infinity value of the float type.
        See Also:
        Constant Field Values
      • NEGATIVE_INFINITY

        public static final float NEGATIVE_INFINITY
        Constant for the negative infinity value of the float type.
        See Also:
        Constant Field Values
      • MIN_NORMAL

        public static final float MIN_NORMAL
        Constant for the smallest positive normal value of the float type.
        Since:
        1.6
        See Also:
        Constant Field Values
      • MAX_EXPONENT

        public static final int MAX_EXPONENT
        Maximum base-2 exponent that a finite value of the float type may have. Equal to Math.getExponent(Float.MAX_VALUE).
        Since:
        1.6
        See Also:
        Constant Field Values
      • MIN_EXPONENT

        public static final int MIN_EXPONENT
        Minimum base-2 exponent that a normal value of the float type may have. Equal to Math.getExponent(Float.MIN_NORMAL).
        Since:
        1.6
        See Also:
        Constant Field Values
      • TYPE

        public static final Class<Float> TYPE
        The Class object that represents the primitive type float.
        Since:
        1.1
      • SIZE

        public static final int SIZE
        Constant for the number of bits needed to represent a float in two's complement form.
        Since:
        1.5
        See Also:
        Constant Field Values
    • Constructor Detail

      • Float

        public Float(float value)
        Constructs a new Float with the specified primitive float value.
        Parameters:
        value - the primitive float value to store in the new instance.
      • Float

        public Float(double value)
        Constructs a new Float with the specified primitive double value.
        Parameters:
        value - the primitive double value to store in the new instance.
    • Method Detail

      • compareTo

        public int compareTo(Float object)
        Compares this object to the specified float object to determine their relative order. There are two special cases:
        • Float.NaN is equal to Float.NaN and it is greater than any other float value, including Float.POSITIVE_INFINITY;
        • +0.0f is greater than -0.0f
        Specified by:
        compareTo in interface Comparable<Float>
        Parameters:
        object - the float object to compare this object to.
        Returns:
        a negative value if the value of this float is less than the value of object; 0 if the value of this float and the value of object are equal; a positive value if the value of this float is greater than the value of object.
        Since:
        1.2
        See Also:
        Comparable
      • byteValue

        public byte byteValue()
        Description copied from class: Number
        Returns this object's value as a byte. Might involve rounding and/or truncating the value, so it fits into a byte.
        Overrides:
        byteValue in class Number
        Returns:
        the primitive byte value of this object.
      • doubleValue

        public double doubleValue()
        Description copied from class: Number
        Returns this object's value as a double. Might involve rounding.
        Specified by:
        doubleValue in class Number
        Returns:
        the primitive double value of this object.
      • equals

        public boolean equals(Object object)
        Tests this double for equality with object. To be equal, object must be an instance of Float and floatToIntBits must give the same value for both objects.

        Note that, unlike ==, -0.0 and +0.0 compare unequal, and NaNs compare equal by this method.

        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare this float with.
        Returns:
        true if the specified object is equal to this Float; false otherwise.
        See Also:
        Object.hashCode()
      • floatToIntBits

        public static int floatToIntBits(float value)
        Returns an integer corresponding to the bits of the given IEEE 754 single precision float value. All Not-a-Number (NaN) values are converted to a single NaN representation (0x7fc00000) (compare to floatToRawIntBits(float)).
      • floatToRawIntBits

        public static int floatToRawIntBits(float value)
        Returns an integer corresponding to the bits of the given IEEE 754 single precision float value. Not-a-Number (NaN) values are preserved (compare to floatToIntBits(float)).
      • floatValue

        public float floatValue()
        Gets the primitive value of this float.
        Specified by:
        floatValue in class Number
        Returns:
        this object's primitive value.
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which Object.equals(java.lang.Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

        Note that hash values must not change over time unless information used in equals comparisons also changes.

        See Writing a correct hashCode method if you intend implementing your own hashCode method.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)
      • intBitsToFloat

        public static float intBitsToFloat(int bits)
        Returns the IEEE 754 single precision float corresponding to the given bits.
      • intValue

        public int intValue()
        Description copied from class: Number
        Returns this object's value as an int. Might involve rounding and/or truncating the value, so it fits into an int.
        Specified by:
        intValue in class Number
        Returns:
        the primitive int value of this object.
      • isInfinite

        public boolean isInfinite()
        Indicates whether this object represents an infinite value.
        Returns:
        true if the value of this float is positive or negative infinity; false otherwise.
      • isInfinite

        public static boolean isInfinite(float f)
        Indicates whether the specified float represents an infinite value.
        Parameters:
        f - the float to check.
        Returns:
        true if the value of f is positive or negative infinity; false otherwise.
      • isNaN

        public boolean isNaN()
        Indicates whether this object is a Not-a-Number (NaN) value.
        Returns:
        true if this float is Not-a-Number; false if it is a (potentially infinite) float number.
      • isNaN

        public static boolean isNaN(float f)
        Indicates whether the specified float is a Not-a-Number (NaN) value.
        Parameters:
        f - the float value to check.
        Returns:
        true if f is Not-a-Number; false if it is a (potentially infinite) float number.
      • longValue

        public long longValue()
        Description copied from class: Number
        Returns this object's value as a long. Might involve rounding and/or truncating the value, so it fits into a long.
        Specified by:
        longValue in class Number
        Returns:
        the primitive long value of this object.
      • parseFloat

        public static float parseFloat(String string)
                                throws NumberFormatException
        Parses the specified string as a float value.
        Parameters:
        string - the string representation of a float value.
        Returns:
        the primitive float value represented by string.
        Throws:
        NumberFormatException - if string can not be parsed as a float value.
        Since:
        1.2
        See Also:
        valueOf(String)
      • shortValue

        public short shortValue()
        Description copied from class: Number
        Returns this object's value as a short. Might involve rounding and/or truncating the value, so it fits into a short.
        Overrides:
        shortValue in class Number
        Returns:
        the primitive short value of this object.
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • toString

        public static String toString(float f)
        Returns a string containing a concise, human-readable description of the specified float value.
        Parameters:
        f - the float to convert to a string.
        Returns:
        a printable representation of f.
      • valueOf

        public static Float valueOf(String string)
                             throws NumberFormatException
        Parses the specified string as a float value.
        Parameters:
        string - the string representation of a float value.
        Returns:
        a Float instance containing the float value represented by string.
        Throws:
        NumberFormatException - if string can not be parsed as a float value.
        See Also:
        parseFloat(String)
      • compare

        public static int compare(float float1,
                  float float2)
        Compares the two specified float values. There are two special cases:
        • Float.NaN is equal to Float.NaN and it is greater than any other float value, including Float.POSITIVE_INFINITY;
        • +0.0f is greater than -0.0f
        Parameters:
        float1 - the first value to compare.
        float2 - the second value to compare.
        Returns:
        a negative value if float1 is less than float2; 0 if float1 and float2 are equal; a positive value if float1 is greater than float2.
        Since:
        1.4
      • valueOf

        public static Float valueOf(float f)
        Returns a Float instance for the specified float value.
        Parameters:
        f - the float value to store in the instance.
        Returns:
        a Float instance containing f.
        Since:
        1.5
      • toHexString

        public static String toHexString(float f)
        Converts the specified float into its hexadecimal string representation.
        Parameters:
        f - the float to convert.
        Returns:
        the hexadecimal string representation of f.
        Since:
        1.5


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 208 / . Delta: 0.04401 с