From 3586aadbc17f5194a1d3b49dd7c4367ef425408d Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Tue, 26 Mar 2024 07:36:12 +0100 Subject: [PATCH] First incomplete draft --- README.adoc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.adoc b/README.adoc index e69de29..d284d99 100644 --- a/README.adoc +++ b/README.adoc @@ -0,0 +1,49 @@ += Expr +Expressions calculator +:authors: Celestino Amoroso +:docinfo: shared +:encoding: utf-8 +:toc: right +:toclevels: 4 +//:toc-title: Indice Generale +:icons: font +:icon-set: fi +:numbered: +//:table-caption: Tabella +//:figure-caption: Diagramma +:docinfo1: +:sectlinks: +:sectanchors: +:source-highlighter: rouge +// :rouge-style: ThankfulEyes +:rouge-style: gruvbox +// :rouge-style: colorful +//:rouge-style: monokay + +toc::[] + +== Expr +_Expr_ is a GO package capable of analysing, interpreting and calculating expressions. + +=== Data types +_Expr_ supports numerical, string, relational, and boolean expressions. + +==== Numbers +Numbers can be integers (GO int64) and float (GO float64). In mixed operations involving integers and floats, integers are automatically promoted to floats. + +.Arithmetic operators +[cols="1,2,4,4"] +|=== +| Symbol | Operation | Description | Examples + +| `+` / `-` | _change sign_ | Change the sign of values | `-1` [-1], `-(+2)` [-2] + +| `+` | _sum_ | Add two values | `-1 + 2` [1], `4 + 0.5` [4.5] + +| `-` | _subtracion_ | Subtract the right value from the left one | `3 - 1` [2], `4 - 0.5` [3.5] + +| `*` | _product_ | Multiply two values | `-1 * 2` [-1], `4 * 0.5` [2.0] + +|=== + +==== String