Skip to content

Inconsistent behavior for negative numbers #26

@Sild

Description

@Sild

Hi, I faced with weird behavior if you write negative number

Here is a pool_request with test to reproduce the behavior

Long story short, highest bits get overwritten by new bits.

I assume it may happens because in this line .to_u8() is called after bit range checks, but I'm not sure.

To fix it in our app, we started convert types to unsigned before calling .write(bit_len, val) - and then it works properly

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