Skip to content

Commit

Permalink
add notes to README for set expressions and operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Apr 19, 2020
1 parent ccac831 commit a708df1
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@ Arithmetic expressions are evaluated following standard rules for operator prece
to override:

()
∩ (set intersection)
∪ (set union)
-
**
* / × ÷ mod
+ -
< > <= >= == != ≠ ≤ ≥
between-and within-and "in range from"-to (ternary) (between is exclusive, within is inclusive, and `in range from` is
inclusive lower-bound and exclusive upper-bound)
in ∈ ∉
not
and ∧
or ∨
? : (ternary)

Functions can be called:

sin sinh abs log2 rnd
cos cosh round log10 randint
tan tanh trunc gcd min
asin rad ceil lcm max
acos deg floor gamma
atan sgn ln hypot
sgn min asin rad lcm
abs max acos deg gamma
round str atan ln hypot
trunc sin sinh log2 nhypot
ceil cos cosh log10 rnd
floor tan tanh gcd


The Basic ArithmeticParser also supports assignment of variables:
Expand All @@ -51,3 +52,9 @@ This last expression could be assigned using '@=' formula assignment:

As `r` is updated, evaluating `area` will be reevaluated using the new value.


Custom expressions can be defined using a simple API. Example parsers
are included for dice rolling, combination/permutation expressions, and
common business calculations. These parsers can be incorporated into
other applications to support the safe evaluation of user-defined
domain-specific expressions.

0 comments on commit a708df1

Please sign in to comment.