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

support/num_traits: AsPrimitive #299

Open
github-actions bot opened this issue Aug 28, 2023 · 1 comment
Open

support/num_traits: AsPrimitive #299

github-actions bot opened this issue Aug 28, 2023 · 1 comment
Assignees
Labels
to do To be done tracker Issue tracked by bot

Comments

@github-actions
Copy link

On 2023-08-28 @recmo wrote in 585c5ce “Merge pull request #298 from recmo/num-traits”:

AsPrimitive

    pow::Pow,
    sign::Unsigned,
    CheckedEuclid, Euclid, Inv, MulAdd, MulAddAssign, Num, NumCast,
};

// TODO: AsPrimitive

// Note. We can not implement `NumBytes` as it requires T to be `AsMut<[u8]>`.
// This is not safe for `Uint` when `BITS % 8 != 0`.

impl<const BITS: usize, const LIMBS: usize> Zero for Uint<BITS, LIMBS> {

From src/support/num_traits.rs:29

@github-actions github-actions bot added to do To be done tracker Issue tracked by bot labels Aug 28, 2023
@moh-eulith
Copy link

moh-eulith commented Jan 20, 2025

Is there an efficient way to get the lowest N bits into u<N> (u8, u16, etc)? I can do u8 via byte(0), but that's about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to do To be done tracker Issue tracked by bot
Projects
None yet
Development

No branches or pull requests

2 participants