View Source Cogito.Maths (Cogito v1.0.0)
Maths expression parser.
Possible inputs:
---(+ 10)
(1 + 2 + 3 - 4 + 5) - 4 * -10
3.14 / 100 * 10000 - (100.0 + (100.1 + 100.2))
((2 * (3 + 4) / 7) + 3) / -5
With custom operations:
1 min 2
10 + 20 max (100.5 min 29.9)
24 max 3 hypot 4 - 2
With variables:
y max 3 hypot 4 - x
((x1 * (x2 + x3) / 7) + 3) / -x4
Summary
Functions
@spec binary(Cogito.parser(), map()) :: Cogito.parser()
@spec parser(map()) :: Cogito.parser()
@spec parser!(map()) :: Cogito.parser!()
@spec term(map()) :: Cogito.parser()
@spec unary(map(), map()) :: Cogito.parser()