/
SofiMut
/
calculator
Обзор
Документация
Войти
/
SofiMut
/
calculator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Calculator.java
19 строк
562 B
Софья Степанова
upload files
07 сен 2025, 12:33
07 сен 2025, 12:33
0c1376c
Код
Авторство
О чём код?
import java.util.function.*; public class Calculator { static Supplier<Calculator> instance = Calculator::new; BinaryOperator<Integer> plus = (x, y) -> x + y; BinaryOperator<Integer> minus = (x, y) -> x - y; BinaryOperator<Integer> multiply = (x, y) -> x * y; BinaryOperator<Integer> devide = (x, y) -> x / y; UnaryOperator<Integer> pow = x -> x * x; UnaryOperator<Integer> abs = x -> x > 0 ? x : x * -1; Predicate<Integer> isPositive = x -> x > 0; Consumer<Integer> println = System.out::println; }