C++ Mathematical Expression Library (ExprTk) https://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow 2016-10-10 18:40:57 +11:00
parent 1edfc341d7
commit 24c9e17e8c
1 changed files with 6 additions and 6 deletions

View File

@ -454,10 +454,10 @@ of C++ compilers:
+----------+---------------------------------------------------------+ +----------+---------------------------------------------------------+
| if | If x is true then return y else return z. | | if | If x is true then return y else return z. |
| | eg: | | | eg: |
| | 1. if(x, y, z) | | | 1. if (x, y, z) |
| | 2. if((x + 1) > 2y, z + 1, w / v) | | | 2. if ((x + 1) > 2y, z + 1, w / v) |
| | 3. if(x > y) z; | | | 3. if (x > y) z; |
| | 4. if(x <= 2*y) { z + w }; | | | 4. if (x <= 2*y) { z + w }; |
+----------+---------------------------------------------------------+ +----------+---------------------------------------------------------+
| if-else | The if-else/else-if statement. Subject to the condition | | if-else | The if-else/else-if statement. Subject to the condition |
| | branch the statement will return either the value of the| | | branch the statement will return either the value of the|
@ -1162,7 +1162,7 @@ zero. The following are examples of variable definitions:
var y := 3; var y := 3;
(c) Initialise z to the expression (c) Initialise z to the expression
var z := if(max(1,x + y) > 2,w,v); var z := if (max(1,x + y) > 2,w,v);
(2) Vector Definition (2) Vector Definition
@ -2834,7 +2834,7 @@ into account when using ExprTk:
}; };
x != while (y > 0) { y -= 1; }; x != while (y > 0) { y -= 1; };
x -= { x -= {
if(min(x,y) < 2 * max(x,y)) if (min(x,y) < 2 * max(x,y))
x + 2; x + 2;
else else
x + y - 3; x + y - 3;