fxpmath
fxpmath copied to clipboard
Incorrect conversion of complex number from float back to integer
I'm using version 0.4.9 and I'm having this surpring behaviour:
num = -1.8186004967338193e-16 - 0.99j
Fxp(num, dtype="s1.13").uraw() # array(16384.-8110.j)
Fxp(num.real, dtype="s1.13").uraw() # array(0)
Fxp(num.imag, dtype="s1.13").uraw() # array(8274)
Is the conversion of a complex number to integer supported? If not, it would be great if the function raises an exception, otherwise the function returns incorrect values