From 827c7440be6321f8ff44721d24269e7b8d490804 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 19 Mar 2019 20:12:19 +0200 Subject: [PATCH] Format code and sync readme --- README.md | 14 +++++++++++++- src/lib.rs | 2 -- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 954f622..14d8f6a 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,18 @@ use evalexpr::*; assert_eq!(eval("1, 2, 3"), Ok(Value::from(vec![Value::from(1), Value::from(2), Value::from(3)]))); ``` +### Builtin Functions + +This crate offers a set of builtin functions. + +| Identifier | Argument Amount | Description | +|------------|-----------------|-------------| +| min | >= 1 | Returns the minimum of the arguments | +| max | >= 1 | Returns the maximum of the arguments | + +The `min` and `max` functions can deal with a mixture of integer and floating point arguments. +They return the result as the type it was passed into the function. + ### Values Operators take values as arguments and produce values as results. @@ -163,7 +175,7 @@ The variant of this enum decides the type on evaluation. Variables have a precedence of 200. -### Functions +### User-Defined Functions This crate also allows to define arbitrary functions to be used in parsed expressions. A function is defined as a `Function` instance. diff --git a/src/lib.rs b/src/lib.rs index 35240a4..34a7059 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -204,8 +204,6 @@ //! See [LICENSE](LICENSE) for details. //! -extern crate core; - mod configuration; pub mod error; mod function;