Class NumberUtils

    • Method Detail

      • add

        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
        x - a numeric value
        y - a numeric value
        the sum of x and y