beltoforion / muparserx

A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more.
http://beltoforion.de/en/muparserx
BSD 2-Clause "Simplified" License
137 stars 60 forks source link

Incorrect Assignment Multiplication #107

Closed drocheam closed 3 years ago

drocheam commented 3 years ago

There's an error in the OprtAssignMul function (mpOprtBinAssign.cpp)

The line 191 *pVar = cmplx_type(a*c-b*d, a*d-b*c);

should be *pVar = cmplx_type(a*c-b*d, a*d+b*c);

Check https://www.math-only-math.com/multiplication-of-two-complex-numbers.html for reference.

beltoforion commented 3 years ago

should be fixed