Skip to content

Unexpected behavior in assignment of fixed point variables initialized with a 2D list #62

@lucacutrignelli

Description

@lucacutrignelli

The following code produce a result that is not what I expect using 2D lists.
Trying to update an element of my 2D list does not succeed
Equivalent code works correctly in case of 1D list

Is this the expected behavior?
In case it is, what is the suggested way of coding the intended behavior?

>>> y = Fxp(dtype='fxp-s6/2')
>>> y([[1.0,0.25,0.5],[0.25,0.5,0.25]])

>>> y[0][0] = y[0][0]+1.0
>>> y[0][0]
fxp-s6/2(1.0)

The operation is correctly performed, but the assignment is not

>>> y[0][0]+1.0
fxp-s6/2(2.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions