We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from fxpmath import Fxp x = Fxp(2j, dtype = 'fxp-u4/0-complex') x/2
the result is fxp-u4/0-complex(0j) rather than 1j
fxp-u4/0-complex(0j)
1j
i could solve the problem by adding x.config.op_method = 'repr'
x.config.op_method = 'repr'
is there any other way to make it work like 2j/2 ? thanks
2j/2
The text was updated successfully, but these errors were encountered:
Clearly, it's a bug!
I did a debug and the problem is that a floordiv with a complex number doesn't work in python nor numpy
floordiv
j2 // 2 # raise TypeError: can't take floor of complex number. np.array(2j) // np.array(2) # result = 0j
The raw method is used bay default in Fxp operation to assure precision, when you use repr the operation is performed using a truediv (/).
raw
repr
truediv
/
In other way, if you use multiplication and give a fractional bit the operation is performed well, but I don't think this is a workaround:
x = Fxp(2j, dtype = 'fxp-u4/1-complex') x * 0.5
fxp-u4/1-complex(1j)
A special method should be implemented for complex division (raw op_method). It would be included in next release!
Sorry, something went wrong.
Fix complex truediv and floordiv methods (issue #53).
86344b7
Issue solved in v0.4.6
No branches or pull requests
the result is
fxp-u4/0-complex(0j)
rather than1j
i could solve the problem by adding
x.config.op_method = 'repr'
is there any other way to make it work like
2j/2
? thanksThe text was updated successfully, but these errors were encountered: