Skip to content

Commit

Permalink
Add missing num_integer re-export, docs (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert authored Oct 12, 2021
1 parent 8a1389e commit ad78235
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fixed-bigint"
version = "0.1.6"
version = "0.1.7"
authors = ["kaidokert <[email protected]>"]
documentation = "https://docs.rs/fixed-bigint"
edition = "2018"
Expand Down
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! A fixed-size big integer implementation, unsigned only.
//! [FixedUInt] implements a [num_traits::PrimInt] trait, mimicking built-in `u8`, `u16` and `u32` types.
//! [num_integer::Integer] is also implemented.
//!
//! Simple usage example:
//! ```
Expand All @@ -25,10 +26,24 @@
//! assert_eq!( a + a , 400u16.into() );
//! assert_eq!( a * &100u8.into(), 20000u16.into() )
//! ```
//!
//! Use Integer trait:
//! ```
//! use fixed_bigint::FixedUInt;
//! use num_integer::Integer;
//!
//! let a : FixedUInt<u8,2> = 400u16.into();
//! assert_eq!( a.is_multiple_of( &(8u8.into()) ) , true );
//! assert_eq!( a.gcd( &(300u16.into() )) , 100u8.into() );
//! assert_eq!( a.lcm( &(440u16.into() )) , 4400u16.into() );
//! ```
/// Re-export num_traits crate
pub use num_traits;

/// Re-export num_integer crate
pub use num_integer;

/// Fixed-size big integer implementation
pub mod fixeduint;

Expand Down

0 comments on commit ad78235

Please sign in to comment.