Package xyz.cofe.num

Class LongNumbers

  • All Implemented Interfaces:
    Numbers<Long>

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

      • LongNumbers

        public LongNumbers()
    • Method Detail

      • zero

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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