Skip to content

Commit

Permalink
docs: update todos
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 5, 2022
1 parent 049a1b5 commit 00f5901
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions extensions/ext-computing/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Computing

library: [fasteval](https://github.com/likebike/fasteval)

```rust
fn main() -> Result<(), fasteval::Error> {
// This example doesn't use any variables, so just use an EmptyNamespace:
let mut ns = fasteval::EmptyNamespace;

let val = fasteval::ez_eval(
"1+2*3/4^5%6 + log(100K) + log(e(),100) + [3*(3-3)/3] + (2<3) && 1.23", &mut ns)?;
// | | | | | | | |
// | | | | | | | boolean logic with short-circuit support
// | | | | | | comparisons
// | | | | | square-brackets act like parenthesis
// | | | | built-in constants: e(), pi()
// | | | 'log' can take an optional first 'base' argument, defaults to 10
// | | numeric literal with suffix: p, n, µ, m, K, M, G, T
// | many built-in functions: print, int, ceil, floor, abs, sign, log, round, min, max, sin, asin, ...
// standard binary operators

assert_eq!(val, 1.23);

Ok(())
}
```

0 comments on commit 00f5901

Please sign in to comment.