You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing multiplications using complex Fxp numbers, the result dtype is not inferred correctly. This can lead to overflow in the resulting value.
As shown above, the result is y = 1j, even though the correct result would be y = 2j, which cannot be represented by dtype = fxp-s2/0-complex.
I suspect the bug is that the inference of the result dtype misses the fact that a complex multiplication also requires an addition/subtraction, requiring another bit to represent the values accurately:
(a + j * b) * (c + j * d) = (ac - bd) + j * (ad + bc)
I am using fxpmath version 0.4.8, installed from PyPI.
The text was updated successfully, but these errors were encountered:
When performing multiplications using complex
Fxp
numbers, the resultdtype
is not inferred correctly. This can lead to overflow in the resulting value.Example:
As shown above, the result is
y = 1j
, even though the correct result would bey = 2j
, which cannot be represented bydtype = fxp-s2/0-complex
.I suspect the bug is that the inference of the result
dtype
misses the fact that a complex multiplication also requires an addition/subtraction, requiring another bit to represent the values accurately:I am using
fxpmath
version 0.4.8, installed from PyPI.The text was updated successfully, but these errors were encountered: