Package xyz.cofe.num

Class DoubleNumbers

  • All Implemented Interfaces:
    Numbers<Double>

    public class DoubleNumbers
    extends Object
    implements Numbers<Double>
    Математические операции над Double
    Author:
    Kamnev Georgiy
    • Constructor Detail

      • DoubleNumbers

        public DoubleNumbers()
    • Method Detail

      • zero

        public Double zero()
        Description copied from interface: Numbers
        Возвращает нулевое число
        Specified by:
        zero in interface Numbers<Double>
        Returns:
        ноль
      • one

        public Double one()
        Description copied from interface: Numbers
        Возвращает единицу
        Specified by:
        one in interface Numbers<Double>
        Returns:
        единица
      • zero

        public boolean zero​(Double n)
        Description copied from interface: Numbers
        Проверяет что число является нулем
        Specified by:
        zero in interface Numbers<Double>
        Parameters:
        n - число
        Returns:
        true - число является нулем
      • undefined

        public boolean undefined​(Double n)
        Description copied from interface: Numbers
        Проверяет что число не определенно
        Specified by:
        undefined in interface Numbers<Double>
        Parameters:
        n - число
        Returns:
        true - число не определенно
      • infinity

        public boolean infinity​(Double n)
        Description copied from interface: Numbers
        Проверяет что число является бесконечностью
        Specified by:
        infinity in interface Numbers<Double>
        Parameters:
        n - число
        Returns:
        true - число является бесконечностью
      • add

        public Double add​(Double a,
                          Double b)
        Description copied from interface: Numbers
        Сложение чисел
        Specified by:
        add in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        сумма чисел
      • sub

        public Double sub​(Double a,
                          Double b)
        Description copied from interface: Numbers
        Вычитание чисел
        Specified by:
        sub in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        разность чисел
      • mul

        public Double mul​(Double a,
                          Double b)
        Description copied from interface: Numbers
        Умножение чисел
        Specified by:
        mul in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        результат умножение
      • div

        public Double div​(Double a,
                          Double b)
        Description copied from interface: Numbers
        Деление чисел
        Specified by:
        div in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        результат деления
      • remainder

        public Double remainder​(Double a,
                                Double b)
        Description copied from interface: Numbers
        Остаток от деления
        Specified by:
        remainder in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        остаток
      • equals

        public boolean equals​(Double a,
                              Double b)
        Description copied from interface: Numbers
        Сравнивает два числа на равность
        Specified by:
        equals in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        true - числа равны
      • more

        public boolean more​(Double a,
                            Double b)
        Description copied from interface: Numbers
        Сравннвает числа
        Specified by:
        more in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        true - число а больше б
      • less

        public boolean less​(Double a,
                            Double b)
        Description copied from interface: Numbers
        Сравннвает числа
        Specified by:
        less in interface Numbers<Double>
        Parameters:
        a - число а
        b - число б
        Returns:
        true - число а меньше б
      • next

        public Double next​(Double n)
        Description copied from interface: Numbers
        Возвращает следующее число
        Specified by:
        next in interface Numbers<Double>
        Parameters:
        n - число
        Returns:
        следующее число
      • prev

        public Double prev​(Double n)
        Description copied from interface: Numbers
        Возвращает предыдущее число
        Specified by:
        prev in interface Numbers<Double>
        Parameters:
        n - число
        Returns:
        предыдущее число