mirror of
https://github.com/ArashPartow/exprtk.git
synced 2025-06-22 16:28:57 +00:00
C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html
This commit is contained in:
@ -360,14 +360,33 @@ static const test_t test_list[] =
|
||||
test_t("-2^4",-16.0),
|
||||
test_t("(-2)^3",-8.0),
|
||||
test_t("(-2)^4",+16.0),
|
||||
test_t("3^2^1",9.0),
|
||||
test_t("3^2^4",43046721.0),
|
||||
test_t("1.1^2.2",1.23328630055466251099),
|
||||
test_t("2.2^1.1",2.3804822576003541627),
|
||||
test_t("2.2^3.3",13.48946876053338489127),
|
||||
test_t("3.3^2.2^1.1",17.15193942371376191362),
|
||||
test_t("1.1^(1.1 * 2.2)", 1.25941916576299080582),
|
||||
test_t("+3.3^2.2^1.1",17.15193942371376191362),
|
||||
test_t("3.3^+2.2^1.1",17.15193942371376191362),
|
||||
test_t("3.3^2.2^+1.1",17.15193942371376191362),
|
||||
test_t("3.3^2.2^-1.1",1.65127293793867959137),
|
||||
test_t("+3.3^+2.2^-1.1",1.65127293793867959137),
|
||||
test_t("1.1^(1.1 * 2.2)",1.25941916576299080582),
|
||||
test_t("2.2^(1.1 * 3.3)",17.49823848953534759743),
|
||||
test_t("3.3^(1.1 * 2.2)",17.98058156638874965269),
|
||||
test_t("1.1^-2.2/1.1",0.73712884727743375853),
|
||||
test_t("1.1^+2.2/1.1",1.121169364140602282717273261774),
|
||||
test_t("1.1^2.2/+1.1",1.121169364140602282717273261774),
|
||||
test_t("1.1^+2.2/+1.1",1.121169364140602282717273261774),
|
||||
test_t("1.1^+2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("1.1^2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("1.1^+2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("+1.1^-2.2/1.1",0.73712884727743375853),
|
||||
test_t("+1.1^+2.2/1.1",1.121169364140602282717273261774),
|
||||
test_t("+1.1^2.2/+1.1",1.121169364140602282717273261774),
|
||||
test_t("+1.1^+2.2/+1.1",1.121169364140602282717273261774),
|
||||
test_t("+1.1^+2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("+1.1^2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("+1.1^+2.2/-1.1",-1.121169364140602282717273261774),
|
||||
test_t("equal(1.23^3,(1.23 * 1.23 * 1.23))",1.0),
|
||||
test_t("equal(1.23^-3,1/(1.23 * 1.23 * 1.23))",1.0),
|
||||
test_t("equal((2.1 + 1.23^3),(2.1 + [1.23 * 1.23 * 1.23]))",1.0),
|
||||
@ -1158,6 +1177,12 @@ inline bool run_test01()
|
||||
test_xy<T>("2x + 3y == 2*x + 3*y" ,T(2.0),T(3.0),T(1.0)),
|
||||
test_xy<T>("2(x + y) == 2*x + 2*y" ,T(2.0),T(3.0),T(1.0)),
|
||||
test_xy<T>(" (x + y)3 == 3*x + 3*y" ,T(2.0),T(3.0),T(1.0)),
|
||||
test_xy<T>("equal(x^2.2^1.1,17.15193942371376191362)" ,T(3.3),T(0.0),T(1.0)),
|
||||
test_xy<T>("equal(3.3^x^1.1,17.15193942371376191362)" ,T(2.2),T(0.0),T(1.0)),
|
||||
test_xy<T>("equal(3.3^2.2^x,17.15193942371376191362)" ,T(1.1),T(0.0),T(1.0)),
|
||||
test_xy<T>("equal(x^2.2^y,17.15193942371376191362)" ,T(3.3),T(1.1),T(1.0)),
|
||||
test_xy<T>("equal(x^y^1.1,17.15193942371376191362)" ,T(3.3),T(2.2),T(1.0)),
|
||||
test_xy<T>("equal(3.3^x^y,17.15193942371376191362)" ,T(2.2),T(1.1),T(1.0)),
|
||||
test_xy<T>("equal(x+y^3/7,x+(y*y*y)/7)",T(2.0),T(3.0),T(1.0)),
|
||||
test_xy<T>("equal(1-x^3+y^2*7,1-(x*x*x)+(y*y)*7)",T(2.0),T(3.0),T(1.0)),
|
||||
test_xy<T>("equal( x^0,1)",T(12.34),T(0.0),T(1.0)),
|
||||
|
Reference in New Issue
Block a user