-
Notifications
You must be signed in to change notification settings - Fork 444
Open
Description
I noticed a potential issue when using SymPy in combination with handcalcs. When performing operations involving complex numbers, parentheses are not added around terms during subtraction or multiplication. This could lead to confusion, especially when negative parts of complex numbers are involved, as the expressions might appear mathematically incorrect.
Here’s an example to illustrate:
from sympy import I
import handcalcs.render%%render
z1 = 3 + I*4
z2 = -4 + I*3
z01 = z1*z2
z02 = z1-z2The rendered output in LaTeX might look like this

Expected Behavior
Parentheses should be automatically placed around subtracted or multiplied terms to clarify the operations:
z01 = (3 + 4i)(-4 + 3i) = -24 - 7i
z02 = 3 + 4i - (-4 + 3i) = 7 + i
Version: 1.9.0
connorferster
Metadata
Metadata
Assignees
Labels
No labels