Skip to content

As (truncating) conversion for BigInt? #404

@digama0

Description

@digama0

I might be missing it, but I don't see a version of Wrapping<u32> or other such wrapping conversions for BigInt. Specifically, I would like to be able to convert n: BigInt to (n % 2^N): uN and (n + 2^(N-1)) % 2^N - 2^(N-1): iN, which is what you would get with as conversion, except that BigInt is not a primitive type so it doesn't have an AsPrimitive implementation. Should this be a new trait, or a function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions