-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
Hi!
I've faced some really strange behavior of sum of Fxp complex array elements. Here is an example:
from fxpmath import Fxp
import numpy as np
DW=12
DATA_FXPTYPE = Fxp(None, signed=True, n_word=DW, n_frac=DW-1)
a = Fxp(np.zeros(2, dtype=complex), like=DATA_FXPTYPE)
c = Fxp(complex(0,0), like=DATA_FXPTYPE)
b = Fxp(0.1-0.1j, like=DATA_FXPTYPE)
print(c.get_val() + b.get_val())
c.equal(c+b)
c.info()
print(a[0].get_val() + b.get_val())
a[0].equal(a[0]+b)
a[0].info()
I've got the following output:
(0.099609375-0.099609375j)
dtype = fxp-s12/11-complex
Value = (0.099609375-0.099609375j)
(0.099609375-0.099609375j)
dtype = fxp-s12/11-complex
Value = 0j
So, for some reason it does work correctly then I am trying to sum single Fxp elements, but if done with Fxp array element something goes wrong, and the value is not updated.
Metadata
Metadata
Assignees
Labels
No labels