Skip to content
New issue

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

bitwise operation for complex data is confusing #55

Open
ruoting0103 opened this issue Feb 15, 2022 · 0 comments
Open

bitwise operation for complex data is confusing #55

ruoting0103 opened this issue Feb 15, 2022 · 0 comments
Milestone

Comments

@ruoting0103
Copy link

bitwise operation of a complex number only applies to real component and yields a non-complex integer,
take x = Fxp(0b11+0b11*1j, dtype = 'fxp-u2/0-complex') as an example ,
x&0b01 outputs fxp-u2/0((1+0j))
the possible expected behaviors should be :

  • 1 raise an exception for this invalid operation , just like the following
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [51], in <module>
      1 data =0b11+0b11*1j
----> 2 data&0b11

TypeError: unsupported operand type(s) for &: 'complex' and 'int'

  • 2 apply the bitwise operation to both real and imag components , this feature should is very useful :)

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants