Class NumberUtils

    • Method Detail

      • add

        @NotNull
        public static <T extends Number> T add​(T x,
                                               T y)
        Add two numeric values and return the sum in the smallest common type.

        Supports Integer, Float and Double values

        Type Parameters:
        T - a numeric data type
        Parameters:
        x - a numeric value
        y - a numeric value
        Returns:
        the sum of x and y