diff --git a/parser/README.md b/parser/README.md index da2e038..dc2dbe6 100644 --- a/parser/README.md +++ b/parser/README.md @@ -37,16 +37,21 @@ Functions: | `cosh` | $\cosh(x)$ | | `cot` | $\cot(x)$ | | `exp` | $\exp(x)$ | +| `inf` | $\inf(X)$ | | `lg` | $\lg(x)$ | | `ln` | $\ln(x)$ | | `log10` | $\log_{10}(x)$ | | `log2` | $\log_2(x)$ | +| `max` | $\sup(X)$ | +| `min` | $\inf(X)$ | | `prod` | $\displaystyle \prod_{i=0}^n x_i$ | | `sgn` | $sgn(x)$ | +| `sign` | $sgn(x)$ | | `sin` | $\sin(x)$ | | `sinh` | $\sinh(x)$ | | `sqrt` | $\sqrt{x}$ | | `sum` | $\displaystyle\sum_{i=0}^n x_i$ | +| `sup` | $\sup(X)$ | | `tan` | $\tan(x)$ | | `tanh` | $\tanh(x)$ | @@ -58,6 +63,6 @@ Floating points: `.`, `,` Functions have only one argument, provided in braces. Operators must have two operands except minus (if it is the first character of equation or braced expression). -`avg`, `sum` and `prod` applied on `numpy.ndarray` produce `float`. +`avg`, `sum`, `max`, `sup`, `min`, `inf` and `prod` applied on `numpy.ndarray` produce `float`. **! There is no error handling yet !** diff --git a/parser/parser/operation.py b/parser/parser/operation.py index 7ff47cd..b6fb0e9 100644 --- a/parser/parser/operation.py +++ b/parser/parser/operation.py @@ -26,18 +26,23 @@ functions: dict[str, FunctionType] = { "cosh": np.cosh, "cot": cot, "exp": np.exp, + "inf": np.inf, "lg": np.log10, "ln": np.log, "log10": np.log10, "log2": np.log2, + "max": np.max, + "min": np.min, "prod": np.prod, "sgn": np.sign, + "sign": np.sign, "sin": np.sin, "sinh": np.sinh, "sqrt": np.sqrt, "sum": np.sum, - "tan": np.tan, + "sup": np.max, "tah": np.tanh, + "tan": np.tan, } operators: dict[str, OperatorType] = {