Package 

Class HalfKt

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static Half h
      private final static Half h
    • Method Summary

      Modifier and Type Method Description
      final Half getH()
      final Half getH()
      final static Half Half(Double value) Converts the specified double-precision float value into a half-precision float value.
      final static Half Half(Float value) Converts the specified single-precision float value into a half-precision float value.
      final static Half Half(String value) Returns the half-precision float value represented by the specified string.
      final static Half toHalf(Double $self) Converts this double-precision float value into a half-precision float value.
      final static Half toHalf(Float $self) Converts this single-precision float value into a half-precision float value.
      final static Half toHalf(String $self) Returns the half-precision float value represented by the specified string.
      final static Half sqrt(Half x)
      final static Half abs(Half x) Returns the absolute value of the specified half-precision float.
      final static Half min(Half x, Half y) Returns the smaller of two half-precision float values (the value closest to negative infinity).
      final static Half max(Half x, Half y) Returns the larger of two half-precision float values (the value closest to positive infinity).
      final static Half round(Half x) Returns the closest integral half-precision float value to the specified half-precision float value.
      final static Half floor(Half x) Returns the largest half-precision float value toward positive infinity less than or equal to the specified half-precision float value.
      final static Half ceil(Half x) Returns the smallest half-precision float value toward negative infinity greater than or equal to the specified half-precision float value.
      final static Half truncate(Half x) Returns the truncated half-precision float value of the specified half-precision float value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • Half

         final static Half Half(String value)

        Returns the half-precision float value represented by the specified string. The string is converted to a half-precision float value as if by the String.toFloat() method.</p>

        Calling this function is equivalent to calling:

        Half(value.toFloat())
        Parameters:
        value - A string to be converted to a {@code Half}
      • toHalf

         final static Half toHalf(String $self)

        Returns the half-precision float value represented by the specified string. The string is converted to a half-precision float value as if by the String.toFloat() method.</p>

        Calling this function is equivalent to calling:

        Half(value.toFloat())
      • abs

         final static Half abs(Half x)

        Returns the absolute value of the specified half-precision float. Special values are handled in the following ways:

        • If the specified half-precision float is NaN, the result is NaN

        • If the specified half-precision float is zero (negative or positive), the result is positive zero (see POSITIVE_ZERO)

        • If the specified half-precision float is infinity (negative or positive), the result is positive infinity (see POSITIVE_INFINITY)

      • min

         final static Half min(Half x, Half y)

        Returns the smaller of two half-precision float values (the value closest to negative infinity). Special values are handled in the following ways:

        Parameters:
        x - The first half-precision value
        y - The second half-precision value
      • max

         final static Half max(Half x, Half y)

        Returns the larger of two half-precision float values (the value closest to positive infinity). Special values are handled in the following ways:

        Parameters:
        x - The first half-precision value
        y - The second half-precision value
      • round

         final static Half round(Half x)

        Returns the closest integral half-precision float value to the specified half-precision float value. Special values are handled in the following ways:

        • If the specified half-precision float is NaN, the result is NaN

        • If the specified half-precision float is infinity (negative or positive), the result is infinity (with the same sign)

        • If the specified half-precision float is zero (negative or positive), the result is zero (with the same sign)

        Parameters:
        x - A half-precision float value
      • floor

         final static Half floor(Half x)

        Returns the largest half-precision float value toward positive infinity less than or equal to the specified half-precision float value. Special values are handled in the following ways:

        • If the specified half-precision float is NaN, the result is NaN

        • If the specified half-precision float is infinity (negative or positive), the result is infinity (with the same sign)

        • If the specified half-precision float is zero (negative or positive), the result is zero (with the same sign)

        Parameters:
        x - A half-precision float value
      • ceil

         final static Half ceil(Half x)

        Returns the smallest half-precision float value toward negative infinity greater than or equal to the specified half-precision float value. Special values are handled in the following ways:

        • If the specified half-precision float is NaN, the result is NaN

        • If the specified half-precision float is infinity (negative or positive), the result is infinity (with the same sign)

        • If the specified half-precision float is zero (negative or positive), the result is zero (with the same sign)

        Parameters:
        x - A half-precision float value
      • truncate

         final static Half truncate(Half x)

        Returns the truncated half-precision float value of the specified half-precision float value. Special values are handled in the following ways:

        • If the specified half-precision float is NaN, the result is NaN

        • If the specified half-precision float is infinity (negative or positive), the result is infinity (with the same sign)

        • If the specified half-precision float is zero (negative or positive), the result is zero (with the same sign)

        Parameters:
        x - A half-precision float value