Repository navigation
[Language Incompatibility] Fix bug in the dec_mult function - #78
Conversation
|
Hi @juanjqo , Thanks. Surprisingly, this seems to have been the case for the entire life of the Could you please add the operator Kind regards, |
|
@mmmarinho Sure thing! |
|
@juanjqo Unfortunately that operator isn't overloadable, so we have our hands tied. I will approve this one than perhaps you might want to open one on MATLAB to implement |
|
Hi, @juanjqo and @mmmarinho. How about overloading another operator, such as Since the remainder operator doesn't make much sense for dual quaternions, I don't see any issues using it. Kind regards, |
@dqrobotics/developers
Hi, @mmmarinho
I believe there is a bug related to language incompatibility in the C++ version. The results for
a .* bin MATLAB are different fromdec_mult(a,b)in C++. They match when I reverse the order in C++a .* b != dec_mult(a,b)a .* b = dec_mult(b,a)This PR fixes the function to match the MATLAB version.
Kind regards,
Juancho
Minimal example
Output
Minimal example (MATLAB)
Output
expected = (0.5 + 0.5i + 0.5j + 0.5k) + E*( - 0.75 + 0.75i + 0.25j - 0.25k) matlab = (0.5 + 0.5i + 0.5j + 0.5k) + E*( - 0.75 + 0.75i + 0.25j - 0.25k) ans = 0