package com.jmj.practice.mathEval;
import cn.hutool.core.util.NumberUtil;
import java.util.Stack;
import java.util.HashMap;
import java.util.Map;
public class AdvancedMathEval {
// 支持的数学函数
private static final Map<String, SingleArgFunction> SINGLE_ARG_FUNCTIONS = new HashMap<>();
private static final Map<String, DoubleArgFunction> DOUBLE_ARG_FUNCTIONS = new HashMap<>();
static {
// 单参数函数
SINGLE_ARG_FUNCTIONS.put("sin", Math::sin);
SINGLE_ARG_FUNCTIONS.put("cos", Math::cos);
SINGLE_ARG_FUNCTIONS.put("tan", Math::tan);
SINGLE_ARG_FUNCTIONS.put("sqrt", Math::sqrt);
SINGLE_ARG_FUNCTIONS.put("log", Math::log);
SINGLE_ARG_FUNCTIONS.put("log10", Math::log10)