Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmyersturnbull/thornless
Safe, fast math eval.
https://github.com/dmyersturnbull/thornless
domain-specific-language math-expressions math-parser
Last synced: 2 days ago
JSON representation
Safe, fast math eval.
- Host: GitHub
- URL: https://github.com/dmyersturnbull/thornless
- Owner: dmyersturnbull
- License: apache-2.0
- Created: 2022-09-03T22:30:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T02:16:33.000Z (over 1 year ago)
- Last Synced: 2024-11-15T17:44:22.845Z (2 months ago)
- Topics: domain-specific-language, math-expressions, math-parser
- Language: ANTLR
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Security: SECURITY.md
Awesome Lists containing this project
README
# Thornless
Safe, moderate-power math expression evaluation.**Example 1: basic math**
```
2 ^ (log2($m) + x)
```**Example 2: vectors**
```
sum([1, 2]) + sin([2, 3]) + 4 + min($vector) + dot($vector, $vector)
```**Example 3: logical operators**
```
$vector > 5 && $vector == $vector
```**Example 4: `any`, `all`, and `none`**
```
any($vector > 5)
```**Example 5: `NaN`**
```
if(sum($vector) > 5? 5 : NaN)
```**Example 6: implicit `NaN`**
```
if(sum($vector) > 5? 5)
```**Example 7: statistics**
```
percentile($vector, 95)
```**Example 7: random variable**
```
if (sample_unif(-100, 100) > $mine? 1 : 0)
```**Example 8: statistical test**
```
$mine = [-55, 22, 144]
$mean = 0
$std = 50
count(sample_norm:100($mean, $std) > $mine))
```