c3d / db48x

RPL runtime for the DM42 calculator, in the spirit of HP48/49/50
http://48calc.org
GNU Lesser General Public License v3.0
85 stars 10 forks source link

NEG on a polar complex converts it to rectangular #289

Closed camillew closed 1 year ago

camillew commented 1 year ago

This happens because NEG(x) is implemented as "0 - x", and the complex implementation of sums and differences forces a conversion to rectangular.

Maybe NEG(x) could be updated to "-1 * x", so that polar representation would be preserved? (I am not sure if this would create other issues.) This would require https://github.com/c3d/DB48X-on-DM42/issues/288 to be fixed first.

c3d commented 1 year ago

Good catch, @camillew. I have a fix for that one. Also highlighted a "usual" problem of having forgotten that % was not a modulo...