is_signed_trait

Crates.iois_signed_trait
lib.rsis_signed_trait
version0.1.0
sourcesrc
created_at2022-01-16 09:21:23.082372
updated_at2022-01-16 09:21:23.082372
descriptionTrait for IS_SIGNED associated constant
homepage
repositoryhttps://github.com/JohnScience/is_signed_trait
max_upload_size
id514708
size17,018
Dmitrii - Demenev (JohnScience)

documentation

https://docs.rs/is_signed_trait

README

Trait for IS_SIGNED associated constant

At the time of writing, separation of implementations for primitive integers depending on whether or not they are signed is complicated because negative trait bounds and impl specialization are available only on Nightly Rust.

This crate alleviates the pain, though does not solve the problem entirely.

Excerpt from Rust's reference:

Numeric types

Integer types

The unsigned integer types consist of:

Type Minimum Maximum

u8 | 0 | 28-1 u16 | 0 | 216-1 u32 | 0 | 232-1 u64 | 0 | 264-1 u128 | 0 | 2128-1

The signed two's complement integer types consist of:

Type Minimum Maximum

i8 | -(27) | 27-1 i16 | -(215) | 215-1 i32 | -(231) | 231-1 i64 | -(263) | 263-1 i128 | -(2127) | 2127-1

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 3

cargo fmt