Package dev.nm.number

Enum DoubleUtils.RoundingScheme

    • Enum Constant Detail

      • DEFAULT

        public static final DoubleUtils.RoundingScheme DEFAULT
        This rounding scheme is the same as in Math.round(float). That is, returning the closest long to the input. The input is rounded to an integer by adding 1/2, taking the floor, and casting it to long.
      • UP

        public static final DoubleUtils.RoundingScheme UP
        Always round up. This is done by taking the ceiling of the input after subtracting a very tiny number.
      • DOWN

        public static final DoubleUtils.RoundingScheme DOWN
        Always round down. This is done by taking the floor of the input after adding a very tiny number.
    • Method Detail

      • values

        public static DoubleUtils.RoundingScheme[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DoubleUtils.RoundingScheme c : DoubleUtils.RoundingScheme.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DoubleUtils.RoundingScheme valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null